feat(medusa, medusa-js, medusa-react): PublishableApiKey "update" endpoint & add "title" property (#2609)
**What** - update PK endpoint - medusa-js/react implementation - add a title property to the entity - update the migration file - pass a title on create - list PKs by title - update the client libs with new param signatures - change id prefix to: "pk_"
This commit is contained in:
@@ -5,6 +5,8 @@ import {
|
||||
AdminPublishableApiKeysRes,
|
||||
GetPublishableApiKeysParams,
|
||||
AdminPublishableApiKeysListRes,
|
||||
AdminPostPublishableApiKeysReq,
|
||||
AdminPostPublishableApiKeysPublishableApiKeyReq,
|
||||
} from "@medusajs/medusa"
|
||||
|
||||
import { ResponsePromise } from "../../typings"
|
||||
@@ -41,13 +43,22 @@ class AdminPublishableApiKeyResource extends BaseResource {
|
||||
}
|
||||
|
||||
create(
|
||||
payload: {},
|
||||
payload: AdminPostPublishableApiKeysReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminPublishableApiKeysRes> {
|
||||
const path = `/admin/publishable-api-keys`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
update(
|
||||
id: string,
|
||||
payload: AdminPostPublishableApiKeysPublishableApiKeyReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
) {
|
||||
const path = `/admin/publishable-api-keys/${id}`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
|
||||
Reference in New Issue
Block a user