fix: check for empty names before pushing edit

This commit is contained in:
Jake Fulmine 2024-07-18 11:25:00 +02:00
parent 852a8a8f00
commit 6e01238364
No known key found for this signature in database
GPG key ID: 177E8DB7BF4C60B2
2 changed files with 4 additions and 0 deletions

View file

@ -25,6 +25,8 @@
err = [];
success = false;
if (!data.name) err.push("Group name cannot be empty.")
if (data.color && !/^#?[A-Fa-f0-9]{6}$/.test(input.color)) {
err.push(`"${data.color}" is not a valid color, the color must be a 6-digit hex code. (example: #ff0000)`);
} else if (data.color) {

View file

@ -24,6 +24,8 @@
let data = input;
err = [];
if (!data.name) err.push("Member name cannot be empty.")
if (data.color && !/^#?[A-Fa-f0-9]{6}$/.test(input.color)) {
err.push(`"${data.color}" is not a valid color, the color must be a 6-digit hex code. (example: #ff0000)`);
} else if (data.color) {