Compare commits
2 Commits
98a8096725
...
b186e7ca23
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b186e7ca23 | ||
|
|
f957cf4e5a |
@ -3,7 +3,7 @@
|
||||
<div class="p-6">
|
||||
<p class="font-serif italic text-[25px] text-D">BRANKAS</p>
|
||||
<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"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<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>
|
||||
|
||||
<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" />
|
||||
<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">
|
||||
@ -99,9 +99,9 @@ const saveTray = async () => {
|
||||
}
|
||||
try {
|
||||
const token = localStorage.getItem("token");
|
||||
const headers = {
|
||||
const headers = {
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
Authorization: `Bearer ${token}`
|
||||
};
|
||||
if (editingTrayId.value) {
|
||||
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 || [];
|
||||
console.log(errors);
|
||||
errorCreate.value = errors[0] || 'Gagal menyimpan nampan.';
|
||||
|
||||
|
||||
clearTimeout(timer.value);
|
||||
timer.value = setTimeout(() => { errorCreate.value = ""; }, 3000);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user