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

@@ -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);