Skip to content

Commit

Permalink
fix: fix dates not being saved (monicahq/chandler#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaiss committed May 13, 2022
1 parent 161aefd commit 5df1726
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -80,7 +80,7 @@ private function validate(): void
$this->validateRules($this->data);

// make sure the vault matches
if ($this->valueOrNull($this->data, 'contact_important_date_type_id')) {
if (! is_null($this->valueOrNull($this->data, 'contact_important_date_type_id'))) {
ContactImportantDateType::where('vault_id', $this->data['vault_id'])
->findOrFail($this->data['contact_important_date_type_id']);
}
Expand Down
Expand Up @@ -55,7 +55,7 @@ public function store(Request $request, int $vaultId, int $contactId)
'author_id' => Auth::user()->id,
'vault_id' => $vaultId,
'contact_id' => $contactId,
'contact_important_date_type_id' => $request->input('contact_important_date_type_id'),
'contact_important_date_type_id' => $request->input('contact_important_date_type_id') == 0 ? null : $request->input('contact_important_date_type_id'),
'label' => $request->input('label'),
'day' => $day,
'month' => $month,
Expand Down

0 comments on commit 5df1726

Please sign in to comment.