add menu dining, transport and change table

This commit is contained in:
aji@catalis.app
2025-06-08 12:19:59 +07:00
parent 797958500c
commit f271341d4a
15 changed files with 209 additions and 100 deletions

View File

@@ -167,12 +167,30 @@
url: "/backoffice/villa",
roles: ["it", "ga", "s&m", "office", "hm", "vm"],
},
{
name: "Transport",
icon: "🚗",
url: "/backoffice/transport",
roles: ["it", "ga", "s&m", "office", "hm", "vm"],
},
{
name: "Dining",
icon: "🍽️",
url: "/backoffice/dining",
roles: ["it", "ga", "s&m", "office", "hm", "vm"],
},
{
name: "Users",
icon: "👤",
url: "/backoffice/account",
roles: ["it", "ga", "office", "hm", "vm"],
},
{
name: "Feedback",
icon: "💬",
url: "/backoffice/feedback",
roles: ["it", "ga", "s&m", "office", "hm", "vm"],
},
{
name: "Logout",
icon: "🚪",

View File

@@ -5,18 +5,26 @@
type StatKey =
| "purchase_orders"
| "issues"
| "villas"
| "vb_villas"
| "inventories"
| "projects"
| "vendors";
| "vendors"
| "vb_employee"
| "vb_transport"
| "vb_dinning"
| "vb_feedback";
let stats: Record<StatKey, number> = {
purchase_orders: 0,
issues: 0,
villas: 0,
vb_villas: 0,
inventories: 0,
projects: 0,
vendors: 0,
vb_employee: 0,
vb_transport: 0,
vb_dinning: 0,
vb_feedback: 0,
};
const items: {
@@ -45,7 +53,7 @@
},
{
label: "Total Villa",
key: "villas",
key: "vb_villas",
color: "text-green-600",
icon: "home",
},
@@ -61,6 +69,30 @@
color: "text-orange-600",
icon: "building-storefront",
},
{
label: "Total Employee",
key: "vb_employee",
color: "text-teal-600",
icon: "user-group",
},
{
label: "Total Transport",
key: "vb_transport",
color: "text-indigo-600",
icon: "truck",
},
{
label: "Total Dinning",
key: "vb_dinning",
color: "text-pink-600",
icon: "utensils",
},
{
label: "Total Feedback",
key: "vb_feedback",
color: "text-gray-600",
icon: "comments",
},
];
onMount(async () => {
@@ -181,6 +213,62 @@
d="M4 4h16v4H4V4zm0 4v12h16V8m-2 4h-4v4h4v-4z"
/>
</svg>
{:else if item.icon === "user-group"}
<svg
class="w-8 h-8 mb-2 text-teal-500"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M16 11a4 4 0 11-8 0 4 4 0 018 0zm-6 5a6.002 6.002 0 00-5.775 4.5A10.001 10.001 0 0112 21a10.001 10.001 0 017.775-5.5A6.002 6.002 0 0012 16h-2z"
/>
</svg>
{:else if item.icon === "truck"}
<svg
class="w-8 h-8 mb-2 text-indigo-500"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M3 16v1a2 2 0 002 2h14a2 2 0 002-2v-1m-1-3V7a2 2 0 00-2-2H7l-4 4v6m18-6h1a1 1 0 011 1v3a1 1 0 01-1 .993L20 .993V7zM5.5 17a1.5 1.5 0 11-3 .001A1.5 1.5 0 015.517zM18.5,17a1.5,1.5,0,1,1,3,.001A1.5,1.5,0,0,1,18.517,17Z"
/>
</svg>
{:else if item.icon === "utensils"}
<svg
class="w-8 h-8 mb-2 text-pink-500"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 8V3m0 5a2 2 0 11-4 0 2 2 0 014 0zm0 0v10m0-10h4a2 2 0 012 2v6a2 2 0 01-2 2h-4a2 2 0 01-2-2V8a2 2 0 012-2z"
/>
</svg>
{:else if item.icon === "comments"}
<svg
class="w-8 h-8 mb-2 text-gray-500"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M8 10h.01M12 10h.01M16 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
{/if}
<!-- LABEL & VALUE -->

View File

@@ -76,7 +76,7 @@
) {
try {
const { data, error, count } = await supabase
.from("users")
.from("vb_users")
.select("*", { count: "exact" })
.ilike("email", `%${search}%`)
.or(`full_name.ilike.%${search}%,nip.ilike.%${search}%`)
@@ -226,7 +226,7 @@
if (isEditing && currentEditingId) {
// Update user in 'users' table
const { error } = await supabase
.from("users")
.from("vb_users")
.update(newUser)
.eq("id", currentEditingId);
@@ -249,7 +249,7 @@
// 2. Insert user in 'users' table with auth user id
const { error } = await supabase
.from("users")
.from("vb_users")
.insert([{ ...newUser, id: authUser.user?.id }]);
if (error) throw error;
}
@@ -264,7 +264,7 @@
if (confirm("Are you sure you want to delete this user?")) {
try {
const { error } = await supabase
.from("users")
.from("vb_users")
.delete()
.eq("id", id);
if (error) throw error;

View File

@@ -133,7 +133,7 @@
}
const { data: userData, error: userError } = await supabase
.from("users")
.from("vb_users")
.select("id, full_name");
if (userError) {
console.error("Error fetching users:", userError);
@@ -232,7 +232,7 @@
limit: number = 10,
) {
let query = supabase
.from("issues")
.from("vb_ssues")
.select("*", { count: "exact" })
.order(sort || "created_at", { ascending: order === "asc" })
.range(offset, offset + limit - 1);
@@ -353,7 +353,7 @@
if (isEditing && currentEditingId) {
const { error } = await supabase
.from("issues")
.from("vb_ssues")
.update(newIssue)
.eq("id", currentEditingId);
@@ -393,7 +393,7 @@
};
const { error } = await supabase
.from("issues")
.from("vb_ssues")
.insert([issueInsert]);
if (error) {
console.error("Error adding issue:", error);
@@ -414,7 +414,7 @@
async function deleteIssue(id: string) {
if (confirm("Are you sure you want to delete this issue?")) {
const { error } = await supabase
.from("issues")
.from("vb_ssues")
.delete()
.eq("id", id);
if (error) {
@@ -469,7 +469,7 @@
async function moveIssueToProject(issueId: string) {
// update move_issue field in the issue
const { error: updateError } = await supabase
.from("issues")
.from("vb_ssues")
.update({ move_issue: "PROJECT" })
.eq("id", issueId);
@@ -479,7 +479,7 @@
}
const { error } = await supabase
.from("projects")
.from("vb_projects")
.insert({ issue_id: issueId });
if (error) {
@@ -495,7 +495,7 @@
async function moveIssueToPurchaseOrder(issueId: string) {
// update move_issue field in the issue
const { error: updateError } = await supabase
.from("issues")
.from("vb_ssues")
.update({ move_issue: "PURCHASE_ORDER" })
.eq("id", issueId);
if (updateError) {
@@ -504,7 +504,7 @@
}
const { error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.insert({ issue_id: issueId });
if (error) {

View File

@@ -67,7 +67,7 @@
if (authUser) {
const { data, error } = await supabase
.from("users")
.from("vb_users")
.select("*")
.eq("id", authUser.id)
.single();
@@ -107,7 +107,7 @@
user.last_updated_by = user.email;
const { error } = await supabase
.from("users")
.from("vb_users")
.update(user)
.eq("id", user.id);

View File

@@ -91,7 +91,7 @@
limit: number = 10,
) {
let query = supabase
.from("projects_data")
.from("vb_projects_data")
.select("*", { count: "exact" })
.order(sortBy || "created_at", { ascending: sortOrder === "asc" })
.range(offset, offset + limit - 1);
@@ -114,7 +114,7 @@
// ambil issue_id dari projects kemudian ambil data issue yang sesuai
const issueIds = data?.map((project: Project) => project.issue_id);
const { data: issueData, error: issueError } = await supabase
.from("issues")
.from("vb_ssues")
.select("*")
.in("id", issueIds || [])
.order("id", { ascending: false });
@@ -243,7 +243,7 @@
//get all id dan name from issues
async function fetchIssueIds() {
const { data, error } = await supabase
.from("issues")
.from("vb_ssues")
.select("id, name")
.order("id", { ascending: false });
@@ -277,7 +277,7 @@
};
const { data, error } = await supabase
.from("projects")
.from("vb_projects")
.update(projectForUpdate)
.eq("id", currentEditingId);
@@ -292,7 +292,7 @@
// tambah ke Purchase Order
const { data: poData, error: poError } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.insert({
issue_id: project.issue_id,
po_status: "REQUESTED",
@@ -343,7 +343,7 @@
if (isEditing && currentEditingId) {
const { data, error } = await supabase
.from("projects")
.from("vb_projects")
.update(projectUpdate)
.eq("id", currentEditingId);
@@ -355,7 +355,7 @@
}
} else {
const { data, error } = await supabase
.from("projects")
.from("vb_projects")
.insert(projectUpdate);
if (error) {
@@ -369,7 +369,10 @@
}
async function deleteProject(id: string) {
const { error } = await supabase.from("projects").delete().eq("id", id);
const { error } = await supabase
.from("vb_projects")
.delete()
.eq("id", id);
if (error) {
console.error("Error deleting project:", error);
@@ -508,7 +511,7 @@
// uncheck
const { data, error } =
await supabase
.from("projects")
.from("vb_projects")
.update({
add_to_po: false,
})

View File

@@ -132,7 +132,7 @@
limit: number = 1000,
) {
let query = supabase
.from("purchaseorder_data")
.from("vb_purchaseorder_data")
.select("*")
.order(sort || "created_at", { ascending: order === "asc" })
.range(offset, offset + limit - 1);
@@ -151,7 +151,7 @@
// fetch issue and villa names
const issueIds = data.map((row) => row.issue_id);
const { data: issues, error: issueError } = await supabase
.from("issues")
.from("vb_ssues")
.select("*")
.in("id", issueIds);
@@ -198,7 +198,7 @@
//fetch all issues
async function fetchIssues() {
const { data, error } = await supabase
.from("issues")
.from("vb_ssues")
.select("id, name");
if (error) {
@@ -214,7 +214,7 @@
async function fetchVendors() {
const { data, error } = await supabase
.from("vendor")
.from("vb_vendor")
.select("id, name");
if (error) {
@@ -301,7 +301,7 @@
if (isEditing && currentEditingId) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update(purchaseOrderInsert)
.eq("id", currentEditingId);
@@ -311,7 +311,7 @@
}
} else {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.insert(purchaseOrderInsert);
if (error) {
@@ -326,7 +326,7 @@
async function deleteProject(id: string) {
const { error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.delete()
.eq("id", id);
@@ -405,7 +405,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ proses_to_approval: status, po_status: "REQUESTED" })
.eq("id", id);
@@ -441,7 +441,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ po_status: newPurchaseOrders.po_status })
.eq("id", id);
@@ -455,7 +455,7 @@
async function acknowledgedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ acknowledged: status })
.eq("id", id);
@@ -469,7 +469,7 @@
async function receivedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ receivedOk: status })
.eq("id", id);
@@ -502,7 +502,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ approval: newPurchaseOrders.approval })
.eq("id", id);
@@ -516,7 +516,7 @@
async function completedStatusOk(id: string, status: string) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ completed_status: status })
.eq("id", id);

View File

@@ -121,7 +121,7 @@
limit: number = 1000,
) {
let query = supabase
.from("purchaseorder_data")
.from("vb_purchaseorder_data")
.select("*")
.eq("po_status", "APPROVED")
.order(sort || "created_at", { ascending: order === "asc" })
@@ -141,7 +141,7 @@
// fetch issue and villa names
const issueIds = data.map((row) => row.issue_id);
const { data: issues, error: issueError } = await supabase
.from("issues")
.from("vb_ssues")
.select("*")
.in("id", issueIds);
@@ -185,7 +185,7 @@
//fetch all issues
async function fetchIssues() {
const { data, error } = await supabase
.from("issues")
.from("vb_ssues")
.select("id, name");
if (error) {
@@ -201,7 +201,7 @@
async function fetchVendors() {
const { data, error } = await supabase
.from("vendor")
.from("vb_vendor")
.select("id, name");
if (error) {
@@ -284,7 +284,7 @@
if (isEditing && currentEditingId) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update(purchaseOrderInsert)
.eq("id", currentEditingId);
@@ -294,7 +294,7 @@
}
} else {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.insert(purchaseOrderInsert);
if (error) {
@@ -309,7 +309,7 @@
async function deleteProject(id: string) {
const { error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.delete()
.eq("id", id);
@@ -392,7 +392,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ po_status: newPurchaseOrders.po_status })
.eq("id", id);
@@ -406,7 +406,7 @@
async function acknowledgedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ acknowledged: status, po_status: "ACKNOWLEDGED" })
.eq("id", id);
@@ -420,7 +420,7 @@
async function receivedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ receivedOk: status })
.eq("id", id);
@@ -453,7 +453,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ approval: newPurchaseOrders.approval })
.eq("id", id);
@@ -467,7 +467,7 @@
async function completedStatusOk(id: string, status: string) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ completed_status: status })
.eq("id", id);

View File

@@ -117,7 +117,7 @@
limit: number = 1000,
) {
let query = supabase
.from("purchaseorder_data")
.from("vb_purchaseorder_data")
.select("*")
.eq("po_status", "REQUESTED")
.order(sort || "created_at", { ascending: order === "asc" })
@@ -137,7 +137,7 @@
// fetch issue and villa names
const issueIds = data.map((row) => row.issue_id);
const { data: issues, error: issueError } = await supabase
.from("issues")
.from("vb_ssues")
.select("*")
.in("id", issueIds);
@@ -181,7 +181,7 @@
//fetch all issues
async function fetchIssues() {
const { data, error } = await supabase
.from("issues")
.from("vb_ssues")
.select("id, name");
if (error) {
@@ -197,7 +197,7 @@
async function fetchVendors() {
const { data, error } = await supabase
.from("vendor")
.from("vb_vendor")
.select("id, name");
if (error) {
@@ -280,7 +280,7 @@
if (isEditing && currentEditingId) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update(purchaseOrderInsert)
.eq("id", currentEditingId);
@@ -290,7 +290,7 @@
}
} else {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.insert(purchaseOrderInsert);
if (error) {
@@ -305,7 +305,7 @@
async function deleteProject(id: string) {
const { error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.delete()
.eq("id", id);
@@ -392,7 +392,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ po_status: newPurchaseOrders.po_status })
.eq("id", id);
@@ -406,7 +406,7 @@
async function acknowledgedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ acknowledged: status })
.eq("id", id);
@@ -420,7 +420,7 @@
async function receivedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ receivedOk: status })
.eq("id", id);
@@ -453,7 +453,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({
approval: newPurchaseOrders.approval,
po_status: "APPROVED",
@@ -470,7 +470,7 @@
async function completedStatusOk(id: string, status: string) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ completed_status: status })
.eq("id", id);

View File

@@ -122,7 +122,7 @@
limit: number = 1000,
) {
let query = supabase
.from("purchaseorder_data")
.from("vb_purchaseorder_data")
.select("*")
.eq("po_status", "ACKNOWLEDGED")
.order(sort || "created_at", { ascending: order === "asc" })
@@ -142,7 +142,7 @@
// fetch issue and villa names
const issueIds = data.map((row) => row.issue_id);
const { data: issues, error: issueError } = await supabase
.from("issues")
.from("vb_ssues")
.select("*")
.in("id", issueIds);
@@ -186,7 +186,7 @@
//fetch all issues
async function fetchIssues() {
const { data, error } = await supabase
.from("issues")
.from("vb_ssues")
.select("id, name");
if (error) {
@@ -202,7 +202,7 @@
async function fetchVendors() {
const { data, error } = await supabase
.from("vendor")
.from("vb_vendor")
.select("id, name");
if (error) {
@@ -285,7 +285,7 @@
if (isEditing && currentEditingId) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update(purchaseOrderInsert)
.eq("id", currentEditingId);
@@ -295,7 +295,7 @@
}
} else {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.insert(purchaseOrderInsert);
if (error) {
@@ -310,7 +310,7 @@
async function deleteProject(id: string) {
const { error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.delete()
.eq("id", id);
@@ -374,7 +374,7 @@
async function receivedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ receivedOk: status })
.eq("id", id);
@@ -407,7 +407,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ approval: newPurchaseOrders.approval })
.eq("id", id);
@@ -421,7 +421,7 @@
async function completedStatusOk(id: string, status: string) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ completed_status: status, po_status: status })
.eq("id", id);

View File

@@ -122,7 +122,7 @@
limit: number = 1000,
) {
let query = supabase
.from("purchaseorder_data")
.from("vb_purchaseorder_data")
.select("*")
// RECEIVED COMPLETED or RECEIVE - INCOMPLETE
.in("po_status", ["RECEIVED COMPLETE", "RECEIVED INCOMPLETE"])
@@ -143,7 +143,7 @@
// fetch issue and villa names
const issueIds = data.map((row) => row.issue_id);
const { data: issues, error: issueError } = await supabase
.from("issues")
.from("vb_ssues")
.select("*")
.in("id", issueIds);
@@ -187,7 +187,7 @@
//fetch all issues
async function fetchIssues() {
const { data, error } = await supabase
.from("issues")
.from("vb_ssues")
.select("id, name");
if (error) {
@@ -203,7 +203,7 @@
async function fetchVendors() {
const { data, error } = await supabase
.from("vendor")
.from("vb_vendor")
.select("id, name");
if (error) {
@@ -286,7 +286,7 @@
if (isEditing && currentEditingId) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update(purchaseOrderInsert)
.eq("id", currentEditingId);
@@ -296,7 +296,7 @@
}
} else {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.insert(purchaseOrderInsert);
if (error) {
@@ -311,7 +311,7 @@
async function deleteProject(id: string) {
const { error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.delete()
.eq("id", id);
@@ -394,7 +394,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ po_status: newPurchaseOrders.po_status })
.eq("id", id);
@@ -408,7 +408,7 @@
async function acknowledgedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ acknowledged: status })
.eq("id", id);
@@ -422,7 +422,7 @@
async function receivedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ received: status })
.eq("id", id);
@@ -455,7 +455,7 @@
}
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ approval: newPurchaseOrders.approval })
.eq("id", id);
@@ -469,7 +469,7 @@
async function completedStatusOk(id: string, status: string) {
const { data, error } = await supabase
.from("purchase_orders")
.from("vb_purchase_orders")
.update({ completed_status: status, po_status: status })
.eq("id", id);

View File

@@ -131,7 +131,7 @@
limit: number = 10,
) {
let query = supabase
.from("timesheets")
.from("vb_timesheets")
.select("*", { count: "exact" })
.order(sortColumn || "created_at", {
ascending: sortOrder === "asc",
@@ -240,7 +240,7 @@
if (isEditing && currentEditingId) {
const { error } = await supabase
.from("issues")
.from("vb_ssues")
.update(newIssue)
.eq("id", currentEditingId);
@@ -277,7 +277,7 @@
};
const { error } = await supabase
.from("timesheets")
.from("vb_timesheets")
.insert([TimesheetsInsert]);
if (error) {
console.error("Error adding issue:", error);
@@ -291,7 +291,7 @@
async function deleteTimesheet(id: string) {
if (confirm("Are you sure you want to delete this issue?")) {
const { error } = await supabase
.from("timesheets")
.from("vb_timesheets")
.delete()
.eq("id", id);
if (error) {
@@ -335,7 +335,7 @@
status: string,
): Promise<void> {
const { error } = await supabase
.from("timesheets")
.from("vb_timesheets")
.update({ approval: status })
.eq("id", id);

View File

@@ -48,7 +48,7 @@
offset: number = 0,
) {
let query = supabase
.from("vendor")
.from("vb_vendor")
.select("*", { count: "exact" })
.order(orderBy, { ascending: orderDirection === "asc" })
.range(offset, offset + limit - 1);
@@ -67,7 +67,7 @@
allRowsVendor = data as Vendor[];
const { count: total } = await supabase
.from("vendor")
.from("vb_vendor")
.select("*", { count: "exact" })
.ilike("name", `%${searchTerm}%`);
@@ -118,7 +118,7 @@
async function addVendor() {
const { data, error } = await supabase
.from("vendor")
.from("vb_vendor")
.insert([newVendor])
.select();
@@ -133,7 +133,7 @@
async function updateVendor() {
const { data, error } = await supabase
.from("vendor")
.from("vb_vendor")
.update(newVendor)
.eq("id", currentEditingId)
.select();
@@ -154,7 +154,7 @@
async function deleteVendor(vendorId: string) {
const { error } = await supabase
.from("vendor")
.from("vb_vendor")
.delete()
.eq("id", vendorId);

View File

@@ -152,7 +152,7 @@
}
const { data: userData, error: userError } = await supabase
.from("users")
.from("vb_users")
.select("id, full_name");
if (userError) {
console.error("Error fetching users:", userError);
@@ -256,7 +256,7 @@
created_at: new Date().toISOString(),
};
const { data, error } = await supabase.from("issues").insert([issue]);
const { data, error } = await supabase.from("vb_ssues").insert([issue]);
if (error) {
console.error("Error submitting issue:", error);

View File

@@ -15,7 +15,7 @@
error = loginError.message;
} else {
const { data: dataUser, error: eror } = await supabase
.from("users")
.from("vb_users")
.select("*")
.eq("id", data.user.id)
.single();