update by for issue
This commit is contained in:
@@ -523,10 +523,22 @@
|
|||||||
|
|
||||||
// insert id issue to purchase order
|
// insert id issue to purchase order
|
||||||
async function moveIssueToPurchaseOrder(issueId: string) {
|
async function moveIssueToPurchaseOrder(issueId: string) {
|
||||||
|
// get user id from session
|
||||||
|
const session = await supabase.auth.getSession();
|
||||||
|
if (!session) {
|
||||||
|
console.error("User not authenticated");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const userId = session.data.session?.user.id;
|
||||||
// update move_issue field in the issue
|
// update move_issue field in the issue
|
||||||
const { error: updateError } = await supabase
|
const { error: updateError } = await supabase
|
||||||
.from("vb_issues")
|
.from("vb_issues")
|
||||||
.update({ move_issue: "PURCHASE_ORDER" })
|
.update({
|
||||||
|
move_issue: "PURCHASE_ORDER",
|
||||||
|
updated_by: userId,
|
||||||
|
updated_at: new Date().toISOString(),
|
||||||
|
})
|
||||||
.eq("id", issueId);
|
.eq("id", issueId);
|
||||||
if (updateError) {
|
if (updateError) {
|
||||||
console.error("Error updating issue move_issue:", updateError);
|
console.error("Error updating issue move_issue:", updateError);
|
||||||
|
|||||||
Reference in New Issue
Block a user