feat(dashboard,js-sdk,types): ability to add refund reason and note (#8466)

what: 

- adds ability to add refund reason and note to a refund

<img width="524" alt="Screenshot 2024-08-06 at 13 06 59" src="https://github.com/user-attachments/assets/51537e9b-170b-4dd6-9de5-6bdea5e26822">

<img width="1090" alt="Screenshot 2024-08-06 at 12 57 18" src="https://github.com/user-attachments/assets/70bc84a4-5ebf-43e9-8416-370fd37ba615">

<img width="247" alt="Screenshot 2024-08-06 at 13 08 46" src="https://github.com/user-attachments/assets/b1dc1d83-7fb8-4af5-9a5b-fddb63ff1812">
This commit is contained in:
Riqwan Thamir
2024-08-08 21:19:08 +00:00
committed by GitHub
parent f9a8fcc0bc
commit a93b025233
10 changed files with 160 additions and 20 deletions
+3
View File
@@ -18,6 +18,7 @@ import { ProductCollection } from "./product-collection"
import { ProductTag } from "./product-tag"
import { ProductType } from "./product-type"
import { ProductVariant } from "./product-variant"
import { RefundReason } from "./refund-reasons"
import { Region } from "./region"
import { Return } from "./return"
import { ReturnReason } from "./return-reason"
@@ -63,6 +64,7 @@ export class Admin {
public currency: Currency
public payment: Payment
public productVariant: ProductVariant
public refundReason: RefundReason
constructor(client: Client) {
this.invite = new Invite(client)
@@ -96,5 +98,6 @@ export class Admin {
this.currency = new Currency(client)
this.payment = new Payment(client)
this.productVariant = new ProductVariant(client)
this.refundReason = new RefundReason(client)
}
}
@@ -0,0 +1,20 @@
import { HttpTypes } from "@medusajs/types"
import { Client } from "../client"
import { ClientHeaders } from "../types"
export class RefundReason {
private client: Client
constructor(client: Client) {
this.client = client
}
async list(query?: HttpTypes.RefundReasonFilters, headers?: ClientHeaders) {
return await this.client.fetch<HttpTypes.RefundReasonsResponse>(
`/admin/refund-reasons`,
{
query,
headers,
}
)
}
}