Skip to content

Commit

Permalink
Await sync users on admin
Browse files Browse the repository at this point in the history
  • Loading branch information
rlho committed Nov 6, 2023
1 parent 72d313d commit 887664a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ export const AdminUsers = () => {
};
};

const addAdminUser = () => {
const addAdminUser = async () => {
if (adminEmails.includes(email)) {
alert('This user is already registered');
return;
}

serverFunctions.appendRow(ADMIN_USER_SHEET_NAME, [
await serverFunctions.appendRow(ADMIN_USER_SHEET_NAME, [
email,
new Date().toString(),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ export const Ban = () => {
};

console.log('trainedEmails', trainedEmails);
const addBanUser = () => {
const addBanUser = async () => {
if (trainedEmails.includes(email)) {
alert('This user is already registered');
return;
}

serverFunctions.appendRow(BAN_SHEET_NAME, [email, new Date().toString()]);
await serverFunctions.appendRow(BAN_SHEET_NAME, [
email,
new Date().toString(),
]);

alert('User has been registered successfully!');
fetchBans();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const Liaisons = () => {
};

console.log('liaisonEmails', liaisonEmails);
const addLiaisonUser = () => {
const addLiaisonUser = async () => {
if (email === '' || department === '') {
alert('Please fill in all the fields');
return;
Expand All @@ -64,7 +64,7 @@ export const Liaisons = () => {
return;
}

serverFunctions.appendRow(LIAISON_SHEET_NAME, [
await serverFunctions.appendRow(LIAISON_SHEET_NAME, [
email,
department,
new Date().toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ export const SafetyTraining = () => {
};

console.log('trainedEmails', trainedEmails);
const addSafetyTrainingUser = () => {
const addSafetyTrainingUser = async () => {
if (trainedEmails.includes(email)) {
alert('This user is already registered');
return;
}

serverFunctions.appendRow(SAFETY_TRAINING_SHEET_NAME, [
await serverFunctions.appendRow(SAFETY_TRAINING_SHEET_NAME, [
email,
new Date().toString(),
]);
Expand Down

0 comments on commit 887664a

Please sign in to comment.