fix: Several fixes to store product endpoints, moved several test suites to HTTP (#7601)

* chore: Move publishable api key tests to HTTP

* chore: Move store tests to HTTP folder

* fix: Add tests for store products, fix several bugs around publishable keys
This commit is contained in:
Stevche Radevski
2024-06-04 21:00:07 +02:00
committed by GitHub
parent d104d1a256
commit e44fe78b96
24 changed files with 2301 additions and 2763 deletions

View File

@@ -9,6 +9,7 @@ import {
import { refetchApiKey } from "../helpers"
import { AdminUpdateApiKeyType } from "../validators"
import { MedusaError } from "@medusajs/utils"
export const GET = async (
req: AuthenticatedMedusaRequest,
@@ -20,6 +21,13 @@ export const GET = async (
req.remoteQueryConfig.fields
)
if (!apiKey) {
throw new MedusaError(
MedusaError.Types.NOT_FOUND,
`API Key with id: ${req.params.id} was not found`
)
}
res.status(200).json({ api_key: apiKey })
}

View File

@@ -5,6 +5,7 @@ export const defaultAdminApiKeyFields = [
"redacted",
"type",
"last_used_at",
"updated_at",
"created_at",
"created_by",
"revoked_at",

View File

@@ -11,7 +11,7 @@ export const AdminGetApiKeyParams = createSelectParams()
export type AdminGetApiKeysParamsType = z.infer<typeof AdminGetApiKeysParams>
export const AdminGetApiKeysParams = createFindParams({
offset: 0,
limit: 50,
limit: 20,
}).merge(
z.object({
q: z.string().optional(),