Skip to content

Commit

Permalink
added tshirt merch option
Browse files Browse the repository at this point in the history
  • Loading branch information
divyack2 committed Sep 17, 2024
1 parent 1a142ac commit 4425d88
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const Environment = z.enum(["PRODUCTION", "DEVELOPMENT", "TESTING"]);

export const MailingListName = z.enum(["rp_interest"]);

const API_BASE = "https://api.reflectionsprojections.org";
// const API_BASE = "http://localhost:3000";
// const API_BASE = "https://api.reflectionsprojections.org";
const API_BASE = "http://localhost:3000";
const WEB_BASE = "https://reflectionsprojections.org";

export const Config = {
Expand Down Expand Up @@ -98,7 +98,8 @@ export const DeviceRedirects: Record<string, string> = {
web: `${WEB_BASE}/auth/`,
dev: `${API_BASE}/auth/dev/`,
mobile: "reflectionsprojections://--/Login",
admin: "https://admin.reflectionsprojections.org/auth/",
// admin: "https://admin.reflectionsprojections.org/auth/",
admin: "http://localhost:5173/auth/",
pwa: "localhost:8081/Login",
};

Expand Down
7 changes: 4 additions & 3 deletions src/services/attendee/attendee-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ attendeeRouter.get(
// Get attendee info via userId
attendeeRouter.get(
"/id/:USERID",
RoleChecker([Role.Enum.USER]),
RoleChecker([Role.Enum.STAFF, Role.Enum.ADMIN]),
async (req, res, next) => {
try {
const userId = req.params.USERID;
Expand Down Expand Up @@ -274,8 +274,7 @@ attendeeRouter.post(
RoleChecker([Role.Enum.STAFF, Role.Enum.ADMIN]),
async (req, res, next) => {
try {
const payload = res.locals.payload;
const userId = payload.userId;
const userId = req.body.userId;
const merchItem = req.params.ITEM;

// Check if the user exists in the database
Expand All @@ -299,6 +298,8 @@ attendeeRouter.post(
merchItem == "Tote" ||
merchItem == "Button"
) {
console.log("ELIGIBLE ", merchItem, user.isEligibleMerch![merchItem])

Check failure on line 301 in src/services/attendee/attendee-router.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `"ELIGIBLE·",·merchItem,·user.isEligibleMerch![merchItem])` with `⏎····················"ELIGIBLE·",⏎····················merchItem,⏎····················user.isEligibleMerch![merchItem]⏎················);`
console.log("REDEEMED ", merchItem, user.hasRedeemedMerch![merchItem])

Check failure on line 302 in src/services/attendee/attendee-router.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `"REDEEMED·",·merchItem,·user.hasRedeemedMerch![merchItem])` with `⏎····················"REDEEMED·",⏎····················merchItem,⏎····················user.hasRedeemedMerch![merchItem]⏎················);`
if (!user.isEligibleMerch![merchItem]) {
return res
.status(StatusCodes.BAD_REQUEST)
Expand Down
4 changes: 2 additions & 2 deletions src/services/attendee/attendee-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ export const AttendeeSchema = new Schema({
isEligibleMerch: {
type: new Schema(
{
Tshirt: { type: Boolean, default: false },
Tshirt: { type: Boolean, default: true },
Button: { type: Boolean, default: false },
Tote: { type: Boolean, default: false },
Cap: { type: Boolean, default: false },
},
{ _id: false }
),
default: {
Tshirt: false,
Tshirt: true,
Button: false,
Tote: false,
Cap: false,
Expand Down
2 changes: 1 addition & 1 deletion src/services/checkin/checkin-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function assignPixelsToUser(userId: string, pixels: number) {

await Database.ATTENDEE.findOneAndUpdate(
{ userId },
{ $set: updatedFields }
{ $set: updatedFields },

Check failure on line 82 in src/services/checkin/checkin-utils.ts

View workflow job for this annotation

GitHub Actions / lint

Delete `,`
);
}

Expand Down

0 comments on commit 4425d88

Please sign in to comment.