Add HTTP DELETE endpoint to CommonController
A new `DeleteObject` method has been added to the `CommonController` class to handle HTTP DELETE requests. This method is asynchronous and processes a `DeleteObjectProcedure` object passed in the request body using the `mediator.Send` function. The result is returned as an HTTP 200 OK response. The `[HttpDelete]` attribute has been applied to the method to designate it as a DELETE endpoint.
This commit is contained in:
@@ -23,4 +23,11 @@ public class CommonController(IMediator mediator) : ControllerBase
|
|||||||
var result = await mediator.Send(procedure, cancel);
|
var result = await mediator.Send(procedure, cancel);
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpDelete]
|
||||||
|
public async Task<IActionResult> DeleteObject([FromBody] DeleteObjectProcedure procedure, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var result = await mediator.Send(procedure, cancel);
|
||||||
|
return Ok(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user