fix layout
This commit is contained in:
parent
7cd3e54402
commit
f957cf4e5a
@ -3,7 +3,7 @@
|
|||||||
<div class="p-6">
|
<div class="p-6">
|
||||||
<p class="font-serif italic text-[25px] text-D">BRANKAS</p>
|
<p class="font-serif italic text-[25px] text-D">BRANKAS</p>
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
<div class="w-full sm:w-64 my-3">
|
<div class="w-full md:w-64 my-3 mb-9">
|
||||||
<searchbar v-model:search="searchQuery"/>
|
<searchbar v-model:search="searchQuery"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<mainLayout>
|
<mainLayout>
|
||||||
<div class="p-6 flex flex-col sm:flex-row justify-between items-start gap-3">
|
<div class="p-6">
|
||||||
<p class="font-serif italic text-[25px] text-D">NAMPAN</p>
|
<p class="font-serif italic text-[25px] text-D">NAMPAN</p>
|
||||||
|
|
||||||
<div class="flex flex-col gap-3 justify-end w-full sm:w-auto">
|
<div class="flex flex-col gap-3 justify-end w-full sm:w-auto my-3">
|
||||||
<Searchbar v-model:search="searchQuery" />
|
<Searchbar v-model:search="searchQuery" />
|
||||||
<div class="flex w-full gap-2" v-if="isAdmin">
|
<div class="flex w-full gap-2" v-if="isAdmin">
|
||||||
<button @click="openModal" class="px-4 py-2 sm:px-2 sm:py-1 hover:bg-B bg-C rounded-md shadow w-full">
|
<button @click="openModal" class="px-4 py-2 sm:px-2 sm:py-1 hover:bg-B bg-C rounded-md shadow w-full">
|
||||||
@ -99,9 +99,9 @@ const saveTray = async () => {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const token = localStorage.getItem("token");
|
const token = localStorage.getItem("token");
|
||||||
const headers = {
|
const headers = {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
Authorization: `Bearer ${token}`
|
Authorization: `Bearer ${token}`
|
||||||
};
|
};
|
||||||
if (editingTrayId.value) {
|
if (editingTrayId.value) {
|
||||||
await axios.put(`/api/nampan/${editingTrayId.value}`, { nama: trayName.value }, { headers });
|
await axios.put(`/api/nampan/${editingTrayId.value}`, { nama: trayName.value }, { headers });
|
||||||
@ -119,7 +119,7 @@ const saveTray = async () => {
|
|||||||
const errors = error.response?.data?.errors?.nama || [];
|
const errors = error.response?.data?.errors?.nama || [];
|
||||||
console.log(errors);
|
console.log(errors);
|
||||||
errorCreate.value = errors[0] || 'Gagal menyimpan nampan.';
|
errorCreate.value = errors[0] || 'Gagal menyimpan nampan.';
|
||||||
|
|
||||||
clearTimeout(timer.value);
|
clearTimeout(timer.value);
|
||||||
timer.value = setTimeout(() => { errorCreate.value = ""; }, 3000);
|
timer.value = setTimeout(() => { errorCreate.value = ""; }, 3000);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user