add menu dining, transport and change table
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user