Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Await sync users on admin #55

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading