fix doctor detail view

This commit is contained in:
Danel Kungla
2025-10-06 19:44:09 +03:00
parent 3f08fbc543
commit d2494f3456
16 changed files with 126 additions and 94 deletions

View File

@@ -6,7 +6,11 @@ import { HttpTypes } from '@medusajs/types';
import { getAuthHeaders, getCacheOptions } from './cookies';
export const retrieveOrder = async (id: string, allowCache = true) => {
export const retrieveOrder = async (
id: string,
allowCache = true,
fields = '*payment_collections.payments,*items,*items.metadata,*items.variant,*items.product',
) => {
const headers = {
...(await getAuthHeaders()),
};
@@ -19,8 +23,7 @@ export const retrieveOrder = async (id: string, allowCache = true) => {
.fetch<HttpTypes.StoreOrderResponse>(`/store/orders/${id}`, {
method: 'GET',
query: {
fields:
'*payment_collections.payments,*items,*items.metadata,*items.variant,*items.product',
fields,
},
headers,
next,
@@ -62,6 +65,14 @@ export const listOrders = async (
.catch((err) => medusaError(err));
};
export const listOrdersByIds = async (ids: string[]) => {
try {
return Promise.all(ids.map((id) => retrieveOrder(id)));
} catch (error) {
console.error('response Error', error);
}
};
export const createTransferRequest = async (
formData: FormData,
): Promise<{