-
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 #3119 from Northeastern-Electric-Racing/feature/re…
…cruitment_and_onboarding Feature/recruitment and onboarding
- Loading branch information
Showing
190 changed files
with
13,178 additions
and
9,247 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 was deleted.
Oops, something went wrong.
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,110 @@ | ||
import { NextFunction, Request, Response } from 'express'; | ||
import OnboardingServices from '../services/onboarding.services'; | ||
|
||
export default class OnboardingController { | ||
/* Checklists section */ | ||
static async getAllChecklists(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const checklists = await OnboardingServices.getAllChecklists(req.organization); | ||
res.status(200).json(checklists); | ||
} catch (error: unknown) { | ||
return next(error); | ||
} | ||
} | ||
|
||
static async getCheckedChecklists(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const checkedChecklists = await OnboardingServices.getCheckedChecklists(req.currentUser, req.organization); | ||
res.status(200).json(checkedChecklists); | ||
} catch (error: unknown) { | ||
return next(error); | ||
} | ||
} | ||
|
||
static async getUsersChecklists(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const checklists = await OnboardingServices.getUsersChecklists(req.currentUser.userId, req.organization); | ||
res.status(200).json(checklists); | ||
} catch (error: unknown) { | ||
return next(error); | ||
} | ||
} | ||
|
||
static async createChecklist(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const { name, descriptions, isOptional, teamId, teamTypeId, parentChecklistId } = req.body; | ||
const checklist = await OnboardingServices.createChecklist( | ||
req.currentUser, | ||
name, | ||
descriptions, | ||
teamId, | ||
teamTypeId, | ||
parentChecklistId, | ||
req.organization, | ||
isOptional | ||
); | ||
res.status(200).json(checklist); | ||
} catch (error: unknown) { | ||
return next(error); | ||
} | ||
} | ||
|
||
static async editChecklist(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const { checklistId } = req.params; | ||
const { name, descriptions, isOptional, teamId, teamTypeId, parentChecklistId } = req.body; | ||
const checklist = await OnboardingServices.editChecklist( | ||
req.currentUser, | ||
checklistId, | ||
name, | ||
descriptions, | ||
teamId, | ||
teamTypeId, | ||
parentChecklistId, | ||
req.organization, | ||
isOptional | ||
); | ||
res.status(200).json(checklist); | ||
} catch (error: unknown) { | ||
return next(error); | ||
} | ||
} | ||
|
||
static async deleteChecklist(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const { checklistId } = req.params; | ||
await OnboardingServices.deleteChecklist(req.currentUser, checklistId, req.organization); | ||
res.status(200).json({ message: 'Checklist deleted successfully' }); | ||
} catch (error: unknown) { | ||
return next(error); | ||
} | ||
} | ||
|
||
static async toggleChecklist(req: Request, res: Response, next: NextFunction) { | ||
try { | ||
const { checklistId } = req.params; | ||
|
||
const updatedItem = await OnboardingServices.toggleChecklist(checklistId, req.currentUser, req.organization); | ||
res.status(200).json(updatedItem); | ||
} catch (error: unknown) { | ||
return next(error); | ||
} | ||
} | ||
|
||
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
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
2 changes: 0 additions & 2 deletions
2
src/backend/src/prisma/migrations/20240712210025_added_calendar_event_id_to_dr/migration.sql
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
src/backend/src/prisma/migrations/20240722134821_models_for_faqs_and_milestone/migration.sql
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...kend/src/prisma/migrations/20240722205633_added_description_to_organization/migration.sql
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...c/prisma/migrations/20240723190716_added_description_and_image_to_team_type/migration.sql
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
src/backend/src/prisma/migrations/20240724221505_team_type_calendar/migration.sql
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/backend/src/prisma/migrations/20240726002259_added_images_to_organization/migration.sql
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.