Skip to content

Commit

Permalink
Merge pull request #969 from acm-ucr/khandrew1/teamAPIDiscord
Browse files Browse the repository at this point in the history
changed team api to save discord instead of email
  • Loading branch information
shahdivyank authored Dec 24, 2023
2 parents 28983b5 + 56e0ffe commit 13f2f01
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/api/team/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function POST() {
devpost: "",
figma: "",
},
members: [{ email: user.email, name: user.name, uid: user.id }],
members: [{ discord: user.discord, name: user.name, uid: user.id }],
status: 0,
};
const docRef = await addDoc(collection(db, "teams"), team);
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/teams/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function GET() {
const { links, status, members } = doc.data();

const formattedNames = members.map((member) => member.name);
const formattedEmails = members.map((member) => member.email);
const formattedDiscords = members.map((member) => member.discord);
const formattedUids = members.map((member) => member.uid);
const formattedLinks = Object.entries(links)
.filter(([key, value]) => value !== "")
Expand All @@ -40,7 +40,7 @@ export async function GET() {
output.push({
links: formattedLinks,
members: formattedNames,
emails: formattedEmails,
discords: formattedDiscords,
uids: formattedUids,
status,
uid: doc.id,
Expand Down
2 changes: 1 addition & 1 deletion src/data/dynamic/admin/Teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const TAGS = [
export const HEADERS = [
{ text: "name", size: "w-2/12", icon: true, sort: "off", symbol: "winner" },
{ text: "members", size: "w-2/12", icon: false, sort: "off" },
{ text: "emails", size: "w-3/12", icon: false, sort: "off" },
{ text: "discords", size: "w-3/12", icon: false, sort: "off" },
{ text: "links", size: "w-3/12", icon: false, sort: "off" },
{
text: "status",
Expand Down

0 comments on commit 13f2f01

Please sign in to comment.