fix: modals not closing and cleaned up api

This commit is contained in:
llama committed 2023-10-08 21:49:10 +11:00
1 parent 9833062823
commit 8dce96b196
10 files changed
+841 -44

No files matched your search

+3 -8
View File
@@ -1,10 +1,5 @@
<x-app-layout>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="p-6 text-nexi-black dark:text-gray-100">
{{ __("You're logged in!") }}
<livewire:pages.admin.send/>
</div>
</div>
</div>
@if(auth()->user()->is_admin)
<livewire:pages.admin.send/>
@endif
</x-app-layout>
@@ -1,4 +1,4 @@
<?php
<?php
use Illuminate\Support\Facades\Http;
use Livewire\Attributes\Layout;
@@ -13,9 +13,8 @@ new #[Layout('layouts.app')] class extends Component
public function sendQuote(): void
{
$validated = $this->validate();
$data = ["text" => $validated['quote']];
$response = Http::post(env('SLACK_WEBHOOK_URL'), $data);
$response = Http::post(config('bot.webhook'), ['text' => $validated['quote']]);
$this->quote = '';
}
@@ -31,6 +30,8 @@ new #[Layout('layouts.app')] class extends Component
></x-text-input>
<x-input-error :messages="$errors->get('quote')" class="mt-2"/>
<x-primary-button wire:loading.attr="disabled" wire:loading.class="opacity-50" class="mt-4">{{ __('Request') }}</x-primary-button>
<x-primary-button wire:loading.attr="disabled"
wire:loading.class="opacity-50"
class="mt-4">{{ __('Send') }}</x-primary-button>
</form>
</div>
</div>
@@ -93,6 +93,7 @@ new #[Layout('layouts.guest')] class extends Component
<x-primary-button
wire:loading.attr="disabled"
wire:loading.class="opacity-50"
@click="$dispatch('close')"
class="w-24 ml-3"
>{{ __('Delete') }}</x-primary-button>
</div>
@@ -94,6 +94,7 @@ new #[Layout('layouts.guest')] class extends Component
<x-button
wire:loading.attr="disabled"
wire:loading.class="opacity-50"
@click="$dispatch('close')"
class="bg-nexi-green w-24 ml-3"
>{{ __('Approve') }}</x-button>
</div>
@@ -125,6 +126,7 @@ new #[Layout('layouts.guest')] class extends Component
<x-button
wire:loading.attr="disabled"
wire:loading.class="opacity-50"
@click="$dispatch('close')"
class="bg-nexi-red w-24 ml-3"
>{{ __('Reject') }}</x-button>
</div>