implements HsOfficePartnerController.deletePartnerByUuid
This commit is contained in:
@@ -98,8 +98,18 @@ public class HsOfficePartnerController implements HsOfficePartnersApi {
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ResponseEntity<Void> deletePartnerByUuid(final String currentUser, final String assumedRoles, final UUID userUuid) {
|
||||
return null;
|
||||
public ResponseEntity<Void> deletePartnerByUuid(
|
||||
final String currentUser,
|
||||
final String assumedRoles,
|
||||
final UUID partnerUuid) {
|
||||
context.define(currentUser, assumedRoles);
|
||||
|
||||
final var result = partnerRepo.deleteByUuid(partnerUuid);
|
||||
if (result == 0) {
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -12,6 +12,7 @@ get:
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
description: UUID of the partner to fetch.
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@@ -55,21 +56,21 @@ patch:
|
||||
"403":
|
||||
$ref: './error-responses.yaml#/components/responses/Forbidden'
|
||||
|
||||
|
||||
delete:
|
||||
tags:
|
||||
- hs-office-partners
|
||||
description: 'Delete a single business partner by its uuid, if permitted for the current subject.'
|
||||
operationId: deletePartnerByUuid
|
||||
parameters:
|
||||
- $ref: './auth.yaml#/components/parameters/currentUser'
|
||||
- $ref: './auth.yaml#/components/parameters/assumedRoles'
|
||||
- name: userUuid
|
||||
- name: partnerUUID
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
description: UUID of the user to delete.
|
||||
description: UUID of the partner to delete.
|
||||
responses:
|
||||
"204":
|
||||
description: No Content
|
||||
|
Reference in New Issue
Block a user