feat(F-058): completed feature
This commit is contained in:
@@ -105,6 +105,13 @@ class FakeImageRepository implements ProductImageRepository {
|
||||
.sort((a, b) => a.position - b.position || a.id.localeCompare(b.id));
|
||||
}
|
||||
|
||||
async listByProductIds(productIds: readonly string[]): Promise<ProductImage[]> {
|
||||
const set = new Set(productIds);
|
||||
return this.images
|
||||
.filter((item) => set.has(item.productId))
|
||||
.sort((a, b) => a.position - b.position || a.id.localeCompare(b.id));
|
||||
}
|
||||
|
||||
async attach(productId: string, input: NewProductImage): Promise<ProductImage> {
|
||||
const created = image({
|
||||
id: `img-${this.images.length + 1}`,
|
||||
|
||||
Reference in New Issue
Block a user