feat: images and products loading optimization
This commit is contained in:
@@ -15,7 +15,7 @@ export const apiFetch = ofetch.create({
|
||||
if (data) {
|
||||
const encoded = encodeBase64Unicode(data);
|
||||
options.headers = {
|
||||
...(isDev && { 'XDEBUG_TRIGGER': 'PHPSTORM' }),
|
||||
...(isDev && {'XDEBUG_TRIGGER': 'PHPSTORM'}),
|
||||
...options.headers,
|
||||
'X-Telegram-InitData': encoded,
|
||||
};
|
||||
@@ -131,4 +131,16 @@ export async function heartbeat() {
|
||||
return await ftch('heartbeat');
|
||||
}
|
||||
|
||||
export async function fetchProductById(productId) {
|
||||
return await ftch('product_show', {
|
||||
id: productId,
|
||||
});
|
||||
}
|
||||
|
||||
export async function fetchProductImages(productId) {
|
||||
return await ftch('getProductImages', {
|
||||
id: productId,
|
||||
});
|
||||
}
|
||||
|
||||
export default ftch;
|
||||
|
||||
Reference in New Issue
Block a user