fix(dashboard, js-sdk, types, medusa): separate between delete response with and without parent (#8852)
- Separate the previous `DeleteResponse` to `DeleteResponse` and `DeleteResponseWithParent`, as not every API route's delete response returns a parent. This ensures more accurate types shown in OAS / documentation. - Use `DeleteResponse` or `DeleteResponseWithParent` in response API routes based on what they return - Remove direct usage of `DeleteResponse` in API route, and instead create a type in the `type` package specific for the route / domain. - Use the new types in the `js-sdk` and `dashboard`.
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
import { refetchApiKey } from "../helpers"
|
||||
import { AdminUpdateApiKeyType } from "../validators"
|
||||
import { MedusaError } from "@medusajs/utils"
|
||||
import { DeleteResponse, HttpTypes } from "@medusajs/types"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
@@ -54,7 +54,7 @@ export const POST = async (
|
||||
|
||||
export const DELETE = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse<DeleteResponse<"api_key">>
|
||||
res: MedusaResponse<HttpTypes.AdminApiKeyDeleteResponse>
|
||||
) => {
|
||||
const id = req.params.id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user