Problem
createFirearm and updateFirearm report their operation's error using the translation key for deletion:
// src/lib/actions/firearms.ts:60 (createFirearm)
if (error) redirectWithError("/firearms", t("deleteFailed", { error }), locale);
// src/lib/actions/firearms.ts:104 (updateFirearm)
if (error) redirectWithError("/firearms", t("deleteFailed", { error }), locale);
Impact
If creating a firearm fails, the user reads "the firearm could not be deleted". Confusing, and it makes a good bug report less likely.
Suggested direction
Add createFailed and updateFailed to actionError in messages/{es,en}.json and use them. updateFailed is already defined (used by matches/[id]/actions.ts:194), so adding createFailed is probably enough.
Found during a full code audit. One line per site.
Problem
createFirearmandupdateFirearmreport their operation's error using the translation key for deletion:Impact
If creating a firearm fails, the user reads "the firearm could not be deleted". Confusing, and it makes a good bug report less likely.
Suggested direction
Add
createFailedandupdateFailedtoactionErrorinmessages/{es,en}.jsonand use them.updateFailedis already defined (used bymatches/[id]/actions.ts:194), so addingcreateFailedis probably enough.Found during a full code audit. One line per site.