Skip to content

added patch and delete route for admin - #314

Merged
yusuftomilola merged 1 commit into
DistinctCodes:mainfrom
bernardev254:fix-195-12-backend-implement-update-and-delete-endpoints-for-admin
Oct 3, 2025
Merged

added patch and delete route for admin#314
yusuftomilola merged 1 commit into
DistinctCodes:mainfrom
bernardev254:fix-195-12-backend-implement-update-and-delete-endpoints-for-admin

Conversation

@bernardev254

Copy link
Copy Markdown
Contributor

Description

This PR introduces Update and Delete functionality for the Admin entity, following RESTful best practices and integrating seamlessly with the existing backend structure. Since Admins are represented as User records with the role: admin, these endpoints leverage the existing user service logic with additional role-based restrictions.

Summary of Changes

  1. Added Update Admin Endpoint
  • PATCH /admin/:id
  • nAccepts partial admin data in the request body.
  • Validates input before applying updates.
  • Returns the updated admin object.
  1. Added Delete Admin Endpoint
  • DELETE /admin/:id
  • Removes an admin record by ID.
  • Returns confirmation of deletion (204 No Content).
  1. Role-based Access Control
  • Restricted access to these endpoints via RolesGuard.
  • Only users with role: admin can perform these operations.
  1. Controller & Module Updates
  • Introduced AdminController under /admin.
  • Integrated with UsersService for update and delete logic.

closes #195

@vercel

vercel Bot commented Oct 2, 2025

Copy link
Copy Markdown

@bernardev254 is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@yusuftomilola
yusuftomilola merged commit d623156 into DistinctCodes:main Oct 3, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[12] BACKEND: Implement Update and Delete Endpoints for Admin

2 participants