fix: pickup_code — 6-значное число вместо букв
This commit is contained in:
parent
5867272873
commit
9408b98f06
|
|
@ -300,7 +300,7 @@ export const updateOrderGroupDeliveryChoice = async ({
|
||||||
.eq("id", orderGroupId)
|
.eq("id", orderGroupId)
|
||||||
.single();
|
.single();
|
||||||
if (!existing?.pickup_code) {
|
if (!existing?.pickup_code) {
|
||||||
const code = Math.random().toString(36).substring(2, 8).toUpperCase();
|
const code = String(100000 + Math.floor(Math.random() * 900000));
|
||||||
updatePayload.pickup_code = code;
|
updatePayload.pickup_code = code;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ Deno.serve(async (request) => {
|
||||||
.eq("id", invitation.order_group_id)
|
.eq("id", invitation.order_group_id)
|
||||||
.single();
|
.single();
|
||||||
if (!existingGroup?.pickup_code) {
|
if (!existingGroup?.pickup_code) {
|
||||||
const code = Math.random().toString(36).substring(2, 8).toUpperCase();
|
const code = String(100000 + Math.floor(Math.random() * 900000));
|
||||||
groupUpdateData.pickup_code = code;
|
groupUpdateData.pickup_code = code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ Deno.serve(async (request) => {
|
||||||
updateData.assigned_driver_id = null;
|
updateData.assigned_driver_id = null;
|
||||||
// Generate pickup code if not already set
|
// Generate pickup code if not already set
|
||||||
if (!currentGroup.pickup_code) {
|
if (!currentGroup.pickup_code) {
|
||||||
const code = Math.random().toString(36).substring(2, 8).toUpperCase();
|
const code = String(100000 + Math.floor(Math.random() * 900000));
|
||||||
updateData.pickup_code = code;
|
updateData.pickup_code = code;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue