Allow duplicate card creation
If you are trying to create the same card again it probably means that you have forgotten what it means.
This commit is contained in:
parent
1ea6ff51a8
commit
51122cceef
@ -154,15 +154,6 @@ export async function addExpressionWithRelationships({
|
|||||||
expression_set_id,
|
expression_set_id,
|
||||||
category_ids,
|
category_ids,
|
||||||
}: addExpressionWithRelationshipsParams) {
|
}: addExpressionWithRelationshipsParams) {
|
||||||
const existing = await database.expressions
|
|
||||||
.where("prompt")
|
|
||||||
.equals(expression.prompt)
|
|
||||||
.first();
|
|
||||||
if (existing) {
|
|
||||||
const error_message = `Expression ${expression.prompt} already exists in database`;
|
|
||||||
console.error(error_message);
|
|
||||||
throw new Error(error_message);
|
|
||||||
}
|
|
||||||
return await database.transaction(
|
return await database.transaction(
|
||||||
"rw",
|
"rw",
|
||||||
database.expressions,
|
database.expressions,
|
||||||
|
Loading…
Reference in New Issue
Block a user