-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3113 from Northeastern-Electric-Racing/feature/ho…
…mepage-old-history Feature/homepage old history
- Loading branch information
Showing
121 changed files
with
7,762 additions
and
777 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { NextFunction, Request, Response } from 'express'; | ||
import AnnouncementService from '../services/announcement.service'; | ||
|
||
export default class AnnouncementController { | ||
static async getUserUnreadAnnouncements(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const { organization, currentUser } = req; | ||
|
||
const unreadAnnouncements = await AnnouncementService.getUserUnreadAnnouncements( | ||
currentUser.userId, | ||
organization.organizationId | ||
); | ||
res.status(200).json(unreadAnnouncements); | ||
} catch (error: unknown) { | ||
next(error); | ||
} | ||
} | ||
|
||
static async removeUserAnnouncement(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const { announcementId } = req.params; | ||
const { organization, currentUser } = req; | ||
|
||
const unreadAnnouncements = await AnnouncementService.removeUserAnnouncement( | ||
currentUser.userId, | ||
announcementId, | ||
organization.organizationId | ||
); | ||
res.status(200).json(unreadAnnouncements); | ||
} catch (error: unknown) { | ||
next(error); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { NextFunction, Request, Response } from 'express'; | ||
import OnboardingServices from '../services/onboarding.services'; | ||
|
||
export default class OnboardingController { | ||
static async downloadImage(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const { fileId } = req.params; | ||
|
||
const imageData = await OnboardingServices.downloadImage(fileId); | ||
|
||
// Set the appropriate headers for the HTTP response | ||
res.setHeader('content-type', String(imageData.type)); | ||
res.setHeader('content-length', imageData.buffer.length); | ||
|
||
// Send the Buffer as the response body | ||
res.send(imageData.buffer); | ||
} catch (error: unknown) { | ||
return next(error); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { NextFunction, Request, Response } from 'express'; | ||
import { PopUpService } from '../services/pop-up.services'; | ||
|
||
export default class PopUpsController { | ||
static async getUserUnreadPopUps(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const { organization, currentUser } = req; | ||
|
||
const unreadPopUps = await PopUpService.getUserUnreadPopUps(currentUser.userId, organization.organizationId); | ||
res.status(200).json(unreadPopUps); | ||
} catch (error: unknown) { | ||
next(error); | ||
} | ||
} | ||
|
||
static async removeUserPopUps(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const { popUpId } = req.params; | ||
const { organization, currentUser } = req; | ||
|
||
const unreadPopUps = await PopUpService.removeUserPopUp(currentUser.userId, popUpId, organization.organizationId); | ||
res.status(200).json(unreadPopUps); | ||
} catch (error: unknown) { | ||
next(error); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { getWorkspaceId } from '../integrations/slack'; | ||
import OrganizationsService from '../services/organizations.services'; | ||
import SlackServices from '../services/slack.services'; | ||
|
||
export default class SlackController { | ||
static async processMessageEvent(event: any) { | ||
try { | ||
const organizations = await OrganizationsService.getAllOrganizations(); | ||
const nerSlackWorkspaceId = await getWorkspaceId(); | ||
const relatedOrganization = organizations.find((org) => org.slackWorkspaceId === nerSlackWorkspaceId); | ||
if (relatedOrganization) { | ||
SlackServices.processMessageSent(event, relatedOrganization.organizationId); | ||
} | ||
} catch (error: unknown) { | ||
console.log(error); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/backend/src/prisma-query-args/announcements.query.args.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Prisma } from '@prisma/client'; | ||
import { getUserQueryArgs } from './user.query-args'; | ||
|
||
export type AnnouncementQueryArgs = ReturnType<typeof getAnnouncementQueryArgs>; | ||
|
||
export const getAnnouncementQueryArgs = (organizationId: string) => | ||
Prisma.validator<Prisma.AnnouncementDefaultArgs>()({ | ||
include: { | ||
usersReceived: getUserQueryArgs(organizationId) | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Prisma } from '@prisma/client'; | ||
import { getUserQueryArgs } from './user.query-args'; | ||
|
||
export type PopUpQueryArgs = ReturnType<typeof getPopUpQueryArgs>; | ||
|
||
export const getPopUpQueryArgs = (organizationId: string) => | ||
Prisma.validator<Prisma.PopUpDefaultArgs>()({ | ||
include: { | ||
usersReceived: getUserQueryArgs(organizationId) | ||
} | ||
}); |
2 changes: 0 additions & 2 deletions
2
...ckend/src/prisma/migrations/20241113231854_optional_deadline_assignees_task/migration.sql
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.