Update organization profle

parent faf2da78
......@@ -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