Compare commits
No commits in common. "76c43d869d08f7f2553fb2ab72179888f4ee8207" and "2d37726c62813d117f742a05b19125ac7314890b" have entirely different histories.
76c43d869d
...
2d37726c62
1 changed files with 1 additions and 18 deletions
|
|
@ -5,7 +5,7 @@ import { productInfo, units, productSlots, deliverySlotInfo, specialDeals, store
|
||||||
import { claimUploadUrl, extractKeyFromPresignedUrl, scaffoldAssetUrl } from '@/src/lib/s3-client';
|
import { claimUploadUrl, extractKeyFromPresignedUrl, scaffoldAssetUrl } from '@/src/lib/s3-client';
|
||||||
import { ApiError } from '@/src/lib/api-error';
|
import { ApiError } from '@/src/lib/api-error';
|
||||||
import { eq, and, gt, sql, inArray, desc } from 'drizzle-orm';
|
import { eq, and, gt, sql, inArray, desc } from 'drizzle-orm';
|
||||||
import { getProductById as getProductByIdFromCache, getAllProducts as getAllProductsFromCache } from '@/src/stores/product-store';
|
import { getProductById as getProductByIdFromCache } from '@/src/stores/product-store';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
// Uniform Product Type
|
// Uniform Product Type
|
||||||
|
|
@ -246,21 +246,4 @@ export const productRouter = router({
|
||||||
return { success: true, review: newReview };
|
return { success: true, review: newReview };
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
||||||
getAllProductsSummary: publicProcedure
|
|
||||||
.query(async (): Promise<Product[]> => {
|
|
||||||
// Get all products from cache
|
|
||||||
const allCachedProducts = await getAllProductsFromCache();
|
|
||||||
|
|
||||||
// Transform the cached products to match the expected summary format
|
|
||||||
// (with empty deliverySlots and specialDeals arrays for summary view)
|
|
||||||
const transformedProducts = allCachedProducts.map(product => ({
|
|
||||||
...product,
|
|
||||||
deliverySlots: [], // Empty for summary view
|
|
||||||
specialDeals: [], // Empty for summary view
|
|
||||||
}));
|
|
||||||
|
|
||||||
return transformedProducts;
|
|
||||||
}),
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue