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:
@@ -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 })
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ export const defaultAdminApiKeyFields = [
|
||||
"redacted",
|
||||
"type",
|
||||
"last_used_at",
|
||||
"updated_at",
|
||||
"created_at",
|
||||
"created_by",
|
||||
"revoked_at",
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user