Commit caae35d8 authored by H.M.C. Nadunithara Wijerathne's avatar H.M.C. Nadunithara Wijerathne

Merge branch 'it1924312' into 'master'

Update organization profle

See merge request !8
parents e37019ea 1bcc625c
......@@ -8,7 +8,7 @@
"dev": "yarn build && nodemon lib/index.js",
"burnthemall": "rm -rf node_modules package-lock.json && npm i"
},
"author": "Namit Nathwani",
"author": "H.M.C. Nadunithara Wijerathne",
"license": "ISC",
"dependencies": {
"axios": "^1.3.4",
......
......@@ -82,7 +82,7 @@ export type OrganizationType = {
description: string;
contacts: {
email: string;
phone: string[];
phone: string;
address: AddressType;
website: string;
};
......
import { Router } from "express";
import {
ApplicationType,
JobType,
TypedRequest,
USER_TYPE,
} from "../config/types";
import {
authMiddleware,
candidateMiddleware,
organizationMiddleware,
} from "../middlewares/auth";
import Application from "../models/Application";
import Auth from "../models/Auth";
import Jobs from "../models/Job";
import ResumeAPI from "../utilities/apis/resume";
const router = Router();
......
import { Router } from "express";
import { CandidateType, TypedRequest } from "../config/types";
import { CandidateType, OrganizationType, TypedRequest } from "../config/types";
import { authMiddleware } from "../middlewares/auth";
import Candidates from "../models/Candidate";
import ResumeAPI from "../utilities/apis/resume";
import VoiceAPI from "../utilities/apis/voice";
import Organizations from "../models/Organization";
const router = Router();
......@@ -38,4 +39,20 @@ router.post(
}
);
router.post(
"/organization",
authMiddleware,
async (req: TypedRequest<{ userId: string }, OrganizationType>, res) => {
try {
const update = req.body;
await Organizations.findByIdAndUpdate(req.query.userId, { $set: update });
return res.status(200).json({ data: req.body });
} catch (error) {
return res.status(400).send(error);
}
}
);
module.exports = router;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment