docs: use 200 for routes response across docs (#14418)

This commit is contained in:
Shahed Nasser
2025-12-30 09:36:10 +02:00
committed by GitHub
parent 4ac7b72d10
commit 1de4d1e700
10 changed files with 22 additions and 20 deletions

View File

@@ -58,7 +58,7 @@ export const GET = async (
req: MedusaRequest, req: MedusaRequest,
res: MedusaResponse res: MedusaResponse
) => { ) => {
res.status(201).json({ res.status(200).json({
message: "Hello, World!", message: "Hello, World!",
}) })
} }

View File

@@ -57,7 +57,7 @@ export const generatedEditDates = {
"app/learn/debugging-and-testing/testing-tools/unit-tests/module-example/page.mdx": "2024-09-02T11:04:27.232Z", "app/learn/debugging-and-testing/testing-tools/unit-tests/module-example/page.mdx": "2024-09-02T11:04:27.232Z",
"app/learn/debugging-and-testing/testing-tools/unit-tests/page.mdx": "2024-09-02T11:03:26.997Z", "app/learn/debugging-and-testing/testing-tools/unit-tests/page.mdx": "2024-09-02T11:03:26.997Z",
"app/learn/fundamentals/modules/service-constraints/page.mdx": "2025-03-18T15:12:46.006Z", "app/learn/fundamentals/modules/service-constraints/page.mdx": "2025-03-18T15:12:46.006Z",
"app/learn/fundamentals/api-routes/responses/page.mdx": "2025-09-03T06:21:27.054Z", "app/learn/fundamentals/api-routes/responses/page.mdx": "2025-12-30T06:35:16.514Z",
"app/learn/fundamentals/api-routes/validation/page.mdx": "2025-03-24T06:52:47.896Z", "app/learn/fundamentals/api-routes/validation/page.mdx": "2025-03-24T06:52:47.896Z",
"app/learn/fundamentals/api-routes/errors/page.mdx": "2025-06-19T16:09:08.563Z", "app/learn/fundamentals/api-routes/errors/page.mdx": "2025-06-19T16:09:08.563Z",
"app/learn/fundamentals/admin/constraints/page.mdx": "2025-07-21T08:20:43.223Z", "app/learn/fundamentals/admin/constraints/page.mdx": "2025-07-21T08:20:43.223Z",

View File

@@ -11538,7 +11538,7 @@ export const GET = async (
req: MedusaRequest, req: MedusaRequest,
res: MedusaResponse res: MedusaResponse
) => { ) => {
res.status(201).json({ res.status(200).json({
message: "Hello, World!", message: "Hello, World!",
}) })
} }
@@ -57655,7 +57655,7 @@ export const GET = async (
req: MedusaRequest, req: MedusaRequest,
res: MedusaResponse res: MedusaResponse
) => { ) => {
res.status(201).json({ res.status(200).json({
message: "Hello, World!", message: "Hello, World!",
}) })
} }
@@ -61517,7 +61517,7 @@ export const POST = async (req: AuthenticatedMedusaRequest<CreateUserBody>, res:
}, },
}) })
return res.status(201).json({ user }) return res.status(200).json({ user })
} }
``` ```
@@ -64460,7 +64460,7 @@ export const GET = async (
}, },
}) })
res.set(responseHeaders).status(201).json(result) res.set(responseHeaders).status(200).json(result)
} catch (error) { } catch (error) {
const medusaError = error as MedusaError const medusaError = error as MedusaError
const statusCode = medusaError.type === MedusaError.Types.NOT_FOUND ? 404 : 500 const statusCode = medusaError.type === MedusaError.Types.NOT_FOUND ? 404 : 500
@@ -106540,7 +106540,7 @@ export const POST = async (
}, },
}) })
return res.status(201).json({ user }) return res.status(200).json({ user })
} }
``` ```
@@ -140736,7 +140736,7 @@ export async function POST(
}, },
}) })
return res.sendStatus(201) return res.sendStatus(200)
} }
``` ```
@@ -146991,7 +146991,7 @@ export const POST = async (
} as CreateUserWorkflowInput, } as CreateUserWorkflowInput,
}) })
res.status(201).json({ user: result.user }) res.status(200).json({ user: result.user })
} }
``` ```

View File

@@ -163,7 +163,7 @@ export const GET = async (
req: MedusaRequest, req: MedusaRequest,
res: MedusaResponse res: MedusaResponse
) => { ) => {
res.status(201).json({ res.status(200).json({
message: "Hello, World!", message: "Hello, World!",
}) })
} }

View File

@@ -200,7 +200,7 @@ export const POST = async (req: AuthenticatedMedusaRequest<CreateUserBody>, res:
}, },
}) })
return res.status(201).json({ user }) return res.status(200).json({ user })
} }
``` ```

View File

@@ -2404,7 +2404,7 @@ export const GET = async (
}, },
}) })
res.set(responseHeaders).status(201).json(result) res.set(responseHeaders).status(200).json(result)
} catch (error) { } catch (error) {
const medusaError = error as MedusaError const medusaError = error as MedusaError
const statusCode = medusaError.type === MedusaError.Types.NOT_FOUND ? 404 : 500 const statusCode = medusaError.type === MedusaError.Types.NOT_FOUND ? 404 : 500

View File

@@ -830,7 +830,7 @@ export const POST = async (
}, },
}) })
return res.status(201).json({ user }) return res.status(200).json({ user })
} }
``` ```

View File

@@ -840,7 +840,7 @@ export async function POST(
}, },
}) })
return res.sendStatus(201) return res.sendStatus(200)
} }
``` ```

View File

@@ -977,7 +977,7 @@ export const POST = async (
} as CreateUserWorkflowInput, } as CreateUserWorkflowInput,
}) })
res.status(201).json({ user: result.user }) res.status(200).json({ user: result.user })
} }
``` ```

View File

@@ -568,7 +568,7 @@ export const generatedEditDates = {
"app/medusa-cli/commands/start/page.mdx": "2025-10-13T10:27:25.345Z", "app/medusa-cli/commands/start/page.mdx": "2025-10-13T10:27:25.345Z",
"app/medusa-cli/commands/telemtry/page.mdx": "2025-01-16T09:51:24.323Z", "app/medusa-cli/commands/telemtry/page.mdx": "2025-01-16T09:51:24.323Z",
"app/medusa-cli/commands/user/page.mdx": "2025-09-01T15:36:38.978Z", "app/medusa-cli/commands/user/page.mdx": "2025-09-01T15:36:38.978Z",
"app/recipes/marketplace/examples/restaurant-delivery/page.mdx": "2025-10-21T12:04:46.051Z", "app/recipes/marketplace/examples/restaurant-delivery/page.mdx": "2025-12-30T06:35:28.559Z",
"references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateCustomerGroup/page.mdx": "2024-12-09T13:21:33.569Z", "references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateCustomerGroup/page.mdx": "2024-12-09T13:21:33.569Z",
"references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateReservation/page.mdx": "2025-04-11T09:04:47.498Z", "references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateReservation/page.mdx": "2025-04-11T09:04:47.498Z",
"references/types/HttpTypes/interfaces/types.HttpTypes.AdminCustomerGroup/page.mdx": "2025-05-20T07:51:41.059Z", "references/types/HttpTypes/interfaces/types.HttpTypes.AdminCustomerGroup/page.mdx": "2025-05-20T07:51:41.059Z",
@@ -2164,7 +2164,7 @@ export const generatedEditDates = {
"app/commerce-modules/sales-channel/links-to-other-modules/page.mdx": "2025-04-17T16:00:09.483Z", "app/commerce-modules/sales-channel/links-to-other-modules/page.mdx": "2025-04-17T16:00:09.483Z",
"app/commerce-modules/stock-location/links-to-other-modules/page.mdx": "2025-04-17T16:02:51.467Z", "app/commerce-modules/stock-location/links-to-other-modules/page.mdx": "2025-04-17T16:02:51.467Z",
"app/commerce-modules/store/links-to-other-modules/page.mdx": "2025-12-16T06:36:58.256Z", "app/commerce-modules/store/links-to-other-modules/page.mdx": "2025-12-16T06:36:58.256Z",
"app/examples/page.mdx": "2025-10-28T16:02:32.447Z", "app/examples/page.mdx": "2025-12-30T06:35:28.312Z",
"app/medusa-cli/commands/build/page.mdx": "2025-09-01T15:30:05.995Z", "app/medusa-cli/commands/build/page.mdx": "2025-09-01T15:30:05.995Z",
"app/js-sdk/page.mdx": "2025-12-16T07:15:37.754Z", "app/js-sdk/page.mdx": "2025-12-16T07:15:37.754Z",
"references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.apiKey/page.mdx": "2025-10-31T09:41:41.216Z", "references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.apiKey/page.mdx": "2025-10-31T09:41:41.216Z",
@@ -5556,7 +5556,7 @@ export const generatedEditDates = {
"references/modules/sales_channel_models/page.mdx": "2024-12-10T14:55:13.205Z", "references/modules/sales_channel_models/page.mdx": "2024-12-10T14:55:13.205Z",
"references/types/DmlTypes/types/types.DmlTypes.KnownDataTypes/page.mdx": "2024-12-17T16:57:19.922Z", "references/types/DmlTypes/types/types.DmlTypes.KnownDataTypes/page.mdx": "2024-12-17T16:57:19.922Z",
"references/types/DmlTypes/types/types.DmlTypes.RelationshipTypes/page.mdx": "2024-12-10T14:54:55.435Z", "references/types/DmlTypes/types/types.DmlTypes.RelationshipTypes/page.mdx": "2024-12-10T14:54:55.435Z",
"app/recipes/commerce-automation/restock-notification/page.mdx": "2025-10-28T16:02:37.771Z", "app/recipes/commerce-automation/restock-notification/page.mdx": "2025-12-30T06:35:28.446Z",
"app/integrations/guides/shipstation/page.mdx": "2025-05-20T07:51:40.717Z", "app/integrations/guides/shipstation/page.mdx": "2025-05-20T07:51:40.717Z",
"app/nextjs-starter/guides/customize-stripe/page.mdx": "2025-07-15T08:50:51.997Z", "app/nextjs-starter/guides/customize-stripe/page.mdx": "2025-07-15T08:50:51.997Z",
"references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflow/page.mdx": "2025-12-17T14:30:59.798Z", "references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflow/page.mdx": "2025-12-17T14:30:59.798Z",
@@ -6612,7 +6612,7 @@ export const generatedEditDates = {
"app/data-model-repository-reference/methods/upsert/page.mdx": "2025-10-28T16:02:28.730Z", "app/data-model-repository-reference/methods/upsert/page.mdx": "2025-10-28T16:02:28.730Z",
"app/data-model-repository-reference/methods/update/page.mdx": "2025-10-28T16:02:27.582Z", "app/data-model-repository-reference/methods/update/page.mdx": "2025-10-28T16:02:27.582Z",
"app/data-model-repository-reference/methods/upsertWithReplace/page.mdx": "2025-10-28T16:02:30.479Z", "app/data-model-repository-reference/methods/upsertWithReplace/page.mdx": "2025-10-28T16:02:30.479Z",
"app/how-to-tutorials/tutorials/agentic-commerce/page.mdx": "2025-11-28T07:37:38.151Z", "app/how-to-tutorials/tutorials/agentic-commerce/page.mdx": "2025-12-30T06:35:28.742Z",
"app/storefront-development/production-optimizations/page.mdx": "2025-10-03T13:28:37.909Z", "app/storefront-development/production-optimizations/page.mdx": "2025-10-03T13:28:37.909Z",
"app/how-to-tutorials/tutorials/category-images/page.mdx": "2025-11-07T08:55:59.228Z", "app/how-to-tutorials/tutorials/category-images/page.mdx": "2025-11-07T08:55:59.228Z",
"app/infrastructure-modules/caching/page.mdx": "2025-11-13T14:18:03.173Z", "app/infrastructure-modules/caching/page.mdx": "2025-11-13T14:18:03.173Z",
@@ -6933,5 +6933,7 @@ export const generatedEditDates = {
"references/utils/utils.DevServerUtils/page.mdx": "2025-12-17T14:31:10.749Z", "references/utils/utils.DevServerUtils/page.mdx": "2025-12-17T14:31:10.749Z",
"references/utils/utils.Translation/page.mdx": "2025-12-17T14:31:10.902Z", "references/utils/utils.Translation/page.mdx": "2025-12-17T14:31:10.902Z",
"references/utils/utils.TranslationsUtils/page.mdx": "2025-12-17T14:31:10.873Z", "references/utils/utils.TranslationsUtils/page.mdx": "2025-12-17T14:31:10.873Z",
"references/js_sdk/admin/ShippingOptionType/properties/js_sdk.admin.ShippingOptionType.client/page.mdx": "2025-12-17T14:31:14.186Z" "references/js_sdk/admin/ShippingOptionType/properties/js_sdk.admin.ShippingOptionType.client/page.mdx": "2025-12-17T14:31:14.186Z",
"app/how-to-tutorials/how-to/admin/auth/page.mdx": "2025-12-30T06:35:28.828Z",
"app/integrations/guides/okta/page.mdx": "2025-12-30T06:35:28.653Z"
} }