UpdateAdmin.DTO.ts
Which is inherited by PartialTypes so the values whilst updating the admin are optional for all fields.
AdminInterface.ts
admin.controller.ts
This is my update controller, I want to use the PartialTypes without having to create a second interface for this(I don't know why, That seems wrong to use 2 interfaces).
This is the error that is being displayed on VSCODE.
I tried making a second interface but that seemed wrong as mentioned earlier.
So the solution right now, What I can see is to make a new interface for the Update(Patch/PUT) endpoints.
The Typescript error is clear. All of your UpdateAdminDTO
properties are marked as optional, whilst your Admin
interface expected in the updateAdmin
method for your AdminService
does not allow optional properties.
If you're leaned towards a more DDD-ish design, you will have to map your UpdateAdminDTO
data to your Admin
interface.