clean code
This commit is contained in:
@@ -1 +1,4 @@
|
|||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
|
table td {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
@@ -191,6 +191,7 @@
|
|||||||
.order("villa_name", { ascending: true });
|
.order("villa_name", { ascending: true });
|
||||||
|
|
||||||
if (!villaErr && villaData) {
|
if (!villaErr && villaData) {
|
||||||
|
dataVilla = villaData;
|
||||||
villas = villaData;
|
villas = villaData;
|
||||||
} else {
|
} else {
|
||||||
console.error("Failed to load villas", villaErr);
|
console.error("Failed to load villas", villaErr);
|
||||||
@@ -282,7 +283,7 @@
|
|||||||
}
|
}
|
||||||
// Function to fetch timesheets with optional filters and sorting
|
// Function to fetch timesheets with optional filters and sorting
|
||||||
async function fetchTimeSheets(
|
async function fetchTimeSheets(
|
||||||
villaNameFilter: string | null = null,
|
villaIdFilter: string | null = null,
|
||||||
searchTerm: string | null = null,
|
searchTerm: string | null = null,
|
||||||
sortColumn: string | null = "created_at",
|
sortColumn: string | null = "created_at",
|
||||||
sortOrder: "asc" | "desc" = "desc",
|
sortOrder: "asc" | "desc" = "desc",
|
||||||
@@ -295,11 +296,11 @@
|
|||||||
.order(sortColumn || "created_at", {
|
.order(sortColumn || "created_at", {
|
||||||
ascending: sortOrder === "asc",
|
ascending: sortOrder === "asc",
|
||||||
});
|
});
|
||||||
if (villaNameFilter) {
|
if (villaIdFilter) {
|
||||||
const { data: villaMatch } = await supabase
|
const { data: villaMatch } = await supabase
|
||||||
.from("vb_villas")
|
.from("vb_villas")
|
||||||
.select("id")
|
.select("id")
|
||||||
.eq("villa_name", villaNameFilter);
|
.eq("villa_name", villaIdFilter);
|
||||||
|
|
||||||
const matchedId = villaMatch?.[0]?.id;
|
const matchedId = villaMatch?.[0]?.id;
|
||||||
if (matchedId) {
|
if (matchedId) {
|
||||||
@@ -622,7 +623,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
{:else if col.key === "approved_by"}
|
{:else if col.key === "approved_by"}
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2 align-text-top">
|
||||||
{row[col.key] || "Not Approved"}
|
{row[col.key] || "Not Approved"}
|
||||||
</td>
|
</td>
|
||||||
{:else if col.key === "approved_date"}
|
{:else if col.key === "approved_date"}
|
||||||
|
|||||||
Reference in New Issue
Block a user