Add self-serve status toggle to DepartmentModulesDisplay and API endpoints for enable/disable actions

This commit is contained in:
Jeppe Bundgaard
2026-01-21 10:32:55 +01:00
parent 28d01cb4dd
commit a2aede936e
2 changed files with 95 additions and 12 deletions
+59 -9
View File
@@ -1244,18 +1244,68 @@ paths:
- Departments
summary: Remove category from department
operationId: removeDepartmentCategory
parameters:
- name: department_id
in: query
required: true
schema: {type: integer}
- name: category_id
in: query
required: true
schema: {type: integer}
responses:
'200': {description: Success}
/departments/self-serve/enabled:
get:
tags:
- Departments
summary: Get department self-serve status
description: Check if self-serve is enabled for a specific department
operationId: getDepartmentSelfServeEnabled
parameters:
- name: id
in: query
required: true
description: Department ID
schema:
type: integer
responses:
'200':
description: Successfully retrieved status
content:
application/json:
schema:
type: object
properties:
enabled:
type: boolean
'404':
$ref: '#/components/responses/NotFound'
put:
tags:
- Departments
summary: Update department self-serve status
description: Enable or disable self-serve for a specific department
operationId: updateDepartmentSelfServeEnabled
parameters:
- name: id
in: query
required: true
description: Department ID
schema:
type: integer
- name: enabled
in: query
required: true
description: Enabled status (true/false)
schema:
type: string
enum: ['true', 'false']
responses:
'200':
description: Status updated successfully
content:
application/json:
schema:
type: object
properties:
message:
type: string
'404':
$ref: '#/components/responses/NotFound'
/departments/order/recommended:
get:
tags: