fix(don): dont conflict
This commit is contained in:
+13
-12
@@ -201,7 +201,8 @@ export default async function () {
|
|||||||
})
|
})
|
||||||
.returning({ id: donations.id });
|
.returning({ id: donations.id });
|
||||||
if ($.artifact === "true") {
|
if ($.artifact === "true") {
|
||||||
const res = await tx
|
// const res = await tx
|
||||||
|
await tx
|
||||||
.insert(submissions)
|
.insert(submissions)
|
||||||
.values({
|
.values({
|
||||||
name,
|
name,
|
||||||
@@ -215,17 +216,17 @@ export default async function () {
|
|||||||
// queue: null as unknown as undefined,
|
// queue: null as unknown as undefined,
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
.onConflictDoNothing()
|
.onConflictDoNothing();
|
||||||
.catch(() => "conflict");
|
// .catch(() => "conflict");
|
||||||
if (res === "conflict") {
|
// if (res === "conflict") {
|
||||||
tx.rollback();
|
// tx.rollback();
|
||||||
ph.capture({
|
// ph.capture({
|
||||||
distinctId,
|
// distinctId,
|
||||||
event: "donation_artifact_conflict",
|
// event: "donation_artifact_conflict",
|
||||||
properties: { amount: $.amount, uid: $.uid },
|
// properties: { amount: $.amount, uid: $.uid },
|
||||||
});
|
// });
|
||||||
return { error: { where: "uid", what: "ไม่สามารถสร้างคิวลัดได้" } };
|
// return { error: { where: "uid", what: "ไม่สามารถสร้างคิวลัดได้" } };
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
if ($.amount >= 10)
|
if ($.amount >= 10)
|
||||||
sse.donate.pub("ping", {
|
sse.donate.pub("ping", {
|
||||||
|
|||||||
Reference in New Issue
Block a user