[Done] Mail scheduled sync with db.

This commit is contained in:
guillaume91 2024-05-29 17:08:27 +02:00
parent 43dd3c5e09
commit 4348a28033
3 changed files with 3 additions and 3 deletions

View file

@ -24,6 +24,7 @@ class Project extends Model
'mail_subject', 'mail_subject',
'mail_frequency', 'mail_frequency',
'mail_day', 'mail_day',
'mail_scheduled',
'download_path', 'download_path',
'pivot_json_path', 'pivot_json_path',
'span_json_path', 'span_json_path',

View file

@ -1,10 +1,8 @@
<span class="inline-flex items-center rounded-md {{ $this->getColorClasses() }} px-1.5 py-0.5 text-xs font-medium" <span class="inline-flex items-center rounded-md {{ $this->getColorClasses() }} px-1.5 py-0.5 text-xs font-medium"
@if($this->type) @if($this->type)
x-init="Echo.private(`{{$this->type}}.@js($this->id)`).listen('Project{{ucfirst($this->type)}}Status', (e) => { x-init="Echo.private(`{{$this->type}}.@js($this->id)`).listen('Project{{ucfirst($this->type)}}Status', (e) => {
console.log(e.project{{ucfirst($this->type)}}.status);
if(e.project{{ucfirst($this->type)}}.status){ if(e.project{{ucfirst($this->type)}}.status){
$wire.setStatus(e.project{{ucfirst($this->type)}}.status); $wire.setStatus(e.project{{ucfirst($this->type)}}.status);
console.log('update pending message');
$wire.refreshPendingMessage(); $wire.refreshPendingMessage();
} }
});" });"

View file

@ -79,7 +79,8 @@ class="flex flex-col md:w-2/3"
</div> </div>
</div> </div>
<label class="inline-flex items-center cursor-pointer gap-4"> <label class="inline-flex items-center cursor-pointer gap-4">
<input x-ref="subject" type="checkbox" class="sr-only peer" @click="showMail = $el.checked" x-init="$el.checked = showMail"> <input x-ref="subject" type="checkbox" class="sr-only peer" wire:model="formData.mail_scheduled" @click="showMail = $el.checked" x-init="$el.checked = showMail">
{{-- TODO doesn't save mail_scheduled in DB--}}
<div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-indigo-300 dark:peer-focus:ring-indigo-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-indigo-600"></div> <div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-indigo-300 dark:peer-focus:ring-indigo-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-indigo-600"></div>
</label> </label>
</div> </div>