Skip to content

Commit

Permalink
Merge branch 'feature-organisation' into dev
Browse files Browse the repository at this point in the history
feat: update organisation details
  • Loading branch information
oderahub committed Jul 24, 2024
2 parents 6f5412c + dbdf6ae commit 97b46bc
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
82 changes: 82 additions & 0 deletions src/controllers/updateorgController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,88 @@
import { Request, Response } from "express";
import { UpdateOrganizationDetails } from "../services/updateorg.service";

/**
* @swagger
* /organization/{organization_id}:
* put:
* summary: Update organization details
* description: Updates the details of an organization by its ID.
* tags:
* - Organization
* parameters:
* - in: path
* name: organization_id
* schema:
* type: string
* required: true
* description: The ID of the organization to update
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* name:
* type: string
* address:
* type: string
* phone:
* type: string
* email:
* type: string
* responses:
* 200:
* description: Organization details updated successfully
* content:
* application/json:
* schema:
* type: object
* properties:
* message:
* type: string
* status_code:
* type: integer
* data:
* type: object
* properties:
* id:
* type: string
* name:
* type: string
* address:
* type: string
* phone:
* type: string
* email:
* type: string
* 404:
* description: Organization not found
* content:
* application/json:
* schema:
* type: object
* properties:
* status:
* type: string
* status_code:
* type: integer
* message:
* type: string
* 500:
* description: Failed to update organization details
* content:
* application/json
* schema:
* type: object
* properties:
* status:
* type: string
* status_code:
* type: integer
* message:
* type: string
*/
export const updateOrganization = async (req: Request, res: Response) => {
const { organization_id } = req.params;
const updateData = req.body;
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ server.use("/api/v1/product", productRouter);
server.use("/api/v1/docs", swaggerUi.serve, swaggerUi.setup(swaggerSpec));
server.use("/api/v1/settings", notificationRouter);
server.use("/api/v1/jobs", jobRouter);
server.use("/api/v1/", updateRouter);
server.use("/api/v1/organisation", organisationRoute);
server.use("/api-docs", swaggerUi.serve, swaggerUi.setup(swaggerSpec));
server.use("/api/v1", orgRouter);
server.use("/api/v1", authMiddleware, orgRouter);
Expand Down

0 comments on commit 97b46bc

Please sign in to comment.