feat: Add notification endpoints for admin (#8196)
This commit is contained in:
@@ -5,6 +5,7 @@ import { FulfillmentProvider } from "./fulfillment-provider"
|
||||
import { FulfillmentSet } from "./fulfillment-set"
|
||||
import { InventoryItem } from "./inventory-item"
|
||||
import { Invite } from "./invite"
|
||||
import { Notification } from "./notification"
|
||||
import { Order } from "./order"
|
||||
import { PriceList } from "./price-list"
|
||||
import { PricePreference } from "./price-preference"
|
||||
@@ -44,6 +45,7 @@ export class Admin {
|
||||
public shippingOption: ShippingOption
|
||||
public shippingProfile: ShippingProfile
|
||||
public inventoryItem: InventoryItem
|
||||
public notification: Notification
|
||||
public order: Order
|
||||
public taxRate: TaxRate
|
||||
public taxRegion: TaxRegion
|
||||
@@ -71,6 +73,7 @@ export class Admin {
|
||||
this.shippingOption = new ShippingOption(client)
|
||||
this.shippingProfile = new ShippingProfile(client)
|
||||
this.inventoryItem = new InventoryItem(client)
|
||||
this.notification = new Notification(client)
|
||||
this.order = new Order(client)
|
||||
this.taxRate = new TaxRate(client)
|
||||
this.taxRegion = new TaxRegion(client)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import { Client } from "../client"
|
||||
import { ClientHeaders } from "../types"
|
||||
|
||||
export class Notification {
|
||||
private client: Client
|
||||
constructor(client: Client) {
|
||||
this.client = client
|
||||
}
|
||||
|
||||
async retrieve(
|
||||
id: string,
|
||||
query?: HttpTypes.AdminNotificationParams,
|
||||
headers?: ClientHeaders
|
||||
) {
|
||||
return await this.client.fetch<HttpTypes.AdminNotificationResponse>(
|
||||
`/admin/notifications/${id}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers,
|
||||
query,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
async list(
|
||||
query?: HttpTypes.AdminNotificationListParams,
|
||||
headers?: ClientHeaders
|
||||
) {
|
||||
return await this.client.fetch<HttpTypes.AdminNotificationListResponse>(
|
||||
`/admin/notifications`,
|
||||
{
|
||||
method: "GET",
|
||||
headers,
|
||||
query,
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user