@smess/networking 1.0.16 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/services/store.cart.service.d.ts +139 -0
- package/dist/services/store.cart.service.js +166 -0
- package/dist/services/store.cart.service.test.d.ts +1 -0
- package/dist/services/store.cart.service.test.js +335 -0
- package/dist/services/store.product.service.d.ts +161 -0
- package/dist/services/store.product.service.js +164 -0
- package/dist/services/store.product.service.test.d.ts +1 -0
- package/dist/services/store.product.service.test.js +402 -0
- package/dist/services/store.service.d.ts +9 -0
- package/dist/services/store.service.js +14 -1
- package/package.json +1 -1
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { StoreProductService, } from "./store.product.service";
|
|
2
|
+
import { NetworkingUIEventWrapped, AlertModel, } from "../types/types";
|
|
3
|
+
import { of } from "rxjs";
|
|
4
|
+
describe("StoreProductService", () => {
|
|
5
|
+
const config = {
|
|
6
|
+
baseUrl: "https://api.example.com",
|
|
7
|
+
isProd: false,
|
|
8
|
+
clientId: "test-client-id",
|
|
9
|
+
apiKey: "test-api-key",
|
|
10
|
+
};
|
|
11
|
+
let service;
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
service = new StoreProductService(config);
|
|
14
|
+
});
|
|
15
|
+
describe("getFeaturedProductList", () => {
|
|
16
|
+
it("should get featured product list successfully", async () => {
|
|
17
|
+
const response = {
|
|
18
|
+
data: [
|
|
19
|
+
{
|
|
20
|
+
id: "1",
|
|
21
|
+
name: "Product 1",
|
|
22
|
+
barcode: "123",
|
|
23
|
+
category: "CONGELE",
|
|
24
|
+
vatInPercent: 5.5,
|
|
25
|
+
unit: "piece",
|
|
26
|
+
quantity: 1,
|
|
27
|
+
picture: "image.png",
|
|
28
|
+
slug: "product-1",
|
|
29
|
+
internalCode: "001",
|
|
30
|
+
inventory: true,
|
|
31
|
+
quantityInStock: 10,
|
|
32
|
+
minimumStockQuantity: 5,
|
|
33
|
+
pricePurchase: 10,
|
|
34
|
+
priceToSell: 15,
|
|
35
|
+
discountInPercent: 0,
|
|
36
|
+
priceAfterDiscount: 0,
|
|
37
|
+
expiryDate: null,
|
|
38
|
+
subCategory: null,
|
|
39
|
+
volume: null,
|
|
40
|
+
unitWeight: null,
|
|
41
|
+
articleWeight: null,
|
|
42
|
+
tareWeight: null,
|
|
43
|
+
supplier: null,
|
|
44
|
+
supplierCode: null,
|
|
45
|
+
supplierItemName: null,
|
|
46
|
+
htmlDescription: null,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
51
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
52
|
+
});
|
|
53
|
+
const result = await service.getFeaturedProductList().toPromise();
|
|
54
|
+
expect(result?.hasSuccess).toBe(true);
|
|
55
|
+
expect(result?.response).toEqual(response);
|
|
56
|
+
});
|
|
57
|
+
it("should handle error", async () => {
|
|
58
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
59
|
+
request: () => of(NetworkingUIEventWrapped.failed(AlertModel.default())),
|
|
60
|
+
});
|
|
61
|
+
const result = await service.getFeaturedProductList().toPromise();
|
|
62
|
+
expect(result?.hasFailed).toBe(true);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
describe("getFeaturedProductListByStore", () => {
|
|
66
|
+
it("should get featured product list by store successfully", async () => {
|
|
67
|
+
const storeId = "store-123";
|
|
68
|
+
const response = {
|
|
69
|
+
data: [
|
|
70
|
+
{
|
|
71
|
+
id: "1",
|
|
72
|
+
name: "Product 1",
|
|
73
|
+
barcode: "123",
|
|
74
|
+
category: "CONGELE",
|
|
75
|
+
vatInPercent: 5.5,
|
|
76
|
+
unit: "piece",
|
|
77
|
+
quantity: 1,
|
|
78
|
+
picture: "image.png",
|
|
79
|
+
slug: "product-1",
|
|
80
|
+
internalCode: "001",
|
|
81
|
+
inventory: true,
|
|
82
|
+
quantityInStock: 10,
|
|
83
|
+
minimumStockQuantity: 5,
|
|
84
|
+
pricePurchase: 10,
|
|
85
|
+
priceToSell: 15,
|
|
86
|
+
discountInPercent: 0,
|
|
87
|
+
priceAfterDiscount: 0,
|
|
88
|
+
expiryDate: null,
|
|
89
|
+
subCategory: null,
|
|
90
|
+
volume: null,
|
|
91
|
+
unitWeight: null,
|
|
92
|
+
articleWeight: null,
|
|
93
|
+
tareWeight: null,
|
|
94
|
+
supplier: null,
|
|
95
|
+
supplierCode: null,
|
|
96
|
+
supplierItemName: null,
|
|
97
|
+
htmlDescription: null,
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
};
|
|
101
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
102
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
103
|
+
});
|
|
104
|
+
const result = await service.getFeaturedProductListByStore(storeId).toPromise();
|
|
105
|
+
expect(result?.hasSuccess).toBe(true);
|
|
106
|
+
expect(result?.response).toEqual(response);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
describe("getProductCategoryList", () => {
|
|
110
|
+
it("should get product category list successfully", async () => {
|
|
111
|
+
const response = {
|
|
112
|
+
data: [
|
|
113
|
+
{
|
|
114
|
+
name: "BOISSON",
|
|
115
|
+
numberOfProducts: 443,
|
|
116
|
+
image: null,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "CONGELE",
|
|
120
|
+
numberOfProducts: 324,
|
|
121
|
+
image: null,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
};
|
|
125
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
126
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
127
|
+
});
|
|
128
|
+
const result = await service.getProductCategoryList().toPromise();
|
|
129
|
+
expect(result?.hasSuccess).toBe(true);
|
|
130
|
+
expect(result?.response).toEqual(response);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
describe("getProductById", () => {
|
|
134
|
+
it("should get product by id successfully", async () => {
|
|
135
|
+
const productId = "product-123";
|
|
136
|
+
const response = {
|
|
137
|
+
data: {
|
|
138
|
+
id: productId,
|
|
139
|
+
name: "Product 1",
|
|
140
|
+
barcode: "123",
|
|
141
|
+
category: "CONGELE",
|
|
142
|
+
vatInPercent: 5.5,
|
|
143
|
+
unit: "piece",
|
|
144
|
+
quantity: 1,
|
|
145
|
+
picture: "image.png",
|
|
146
|
+
slug: "product-1",
|
|
147
|
+
internalCode: "001",
|
|
148
|
+
inventory: true,
|
|
149
|
+
quantityInStock: 10,
|
|
150
|
+
minimumStockQuantity: 5,
|
|
151
|
+
pricePurchase: 10,
|
|
152
|
+
priceToSell: 15,
|
|
153
|
+
discountInPercent: 0,
|
|
154
|
+
priceAfterDiscount: 0,
|
|
155
|
+
expiryDate: null,
|
|
156
|
+
subCategory: null,
|
|
157
|
+
volume: null,
|
|
158
|
+
unitWeight: null,
|
|
159
|
+
articleWeight: null,
|
|
160
|
+
tareWeight: null,
|
|
161
|
+
supplier: null,
|
|
162
|
+
supplierCode: null,
|
|
163
|
+
supplierItemName: null,
|
|
164
|
+
htmlDescription: null,
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
168
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
169
|
+
});
|
|
170
|
+
const result = await service.getProductById(productId).toPromise();
|
|
171
|
+
expect(result?.hasSuccess).toBe(true);
|
|
172
|
+
expect(result?.response).toEqual(response);
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
describe("getStoreList", () => {
|
|
176
|
+
it("should get store list successfully", async () => {
|
|
177
|
+
const response = { data: [{ id: "1", name: "Store 1" }] };
|
|
178
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
179
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
180
|
+
});
|
|
181
|
+
const result = await service.getStoreList().toPromise();
|
|
182
|
+
expect(result?.hasSuccess).toBe(true);
|
|
183
|
+
expect(result?.response).toEqual(response);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
describe("getStoreInformation", () => {
|
|
187
|
+
it("should get store information successfully", async () => {
|
|
188
|
+
const storeId = "store-123";
|
|
189
|
+
const response = { data: { id: storeId, name: "Store 1" } };
|
|
190
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
191
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
192
|
+
});
|
|
193
|
+
const result = await service.getStoreInformation(storeId).toPromise();
|
|
194
|
+
expect(result?.hasSuccess).toBe(true);
|
|
195
|
+
expect(result?.response).toEqual(response);
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
describe("getProductCollection", () => {
|
|
199
|
+
it("should get product collection successfully", async () => {
|
|
200
|
+
const payload = {
|
|
201
|
+
page: 1,
|
|
202
|
+
per_page: 10,
|
|
203
|
+
search: "test",
|
|
204
|
+
};
|
|
205
|
+
const response = {
|
|
206
|
+
data: {
|
|
207
|
+
links: {
|
|
208
|
+
first: "/api/v1/store/product-collection?per_page=10&page=1",
|
|
209
|
+
last: "/api/v1/store/product-collection?per_page=10&page=5",
|
|
210
|
+
next: "/api/v1/store/product-collection?per_page=10&page=2",
|
|
211
|
+
},
|
|
212
|
+
items: [
|
|
213
|
+
{
|
|
214
|
+
id: "1",
|
|
215
|
+
name: "Product 1",
|
|
216
|
+
barcode: "123",
|
|
217
|
+
category: "CONGELE",
|
|
218
|
+
vatInPercent: 5.5,
|
|
219
|
+
unit: "piece",
|
|
220
|
+
quantity: 1,
|
|
221
|
+
picture: "image.png",
|
|
222
|
+
slug: "product-1",
|
|
223
|
+
internalCode: "001",
|
|
224
|
+
inventory: true,
|
|
225
|
+
quantityInStock: 10,
|
|
226
|
+
minimumStockQuantity: 5,
|
|
227
|
+
pricePurchase: 10,
|
|
228
|
+
priceToSell: 15,
|
|
229
|
+
discountInPercent: 0,
|
|
230
|
+
priceAfterDiscount: 0,
|
|
231
|
+
expiryDate: null,
|
|
232
|
+
subCategory: null,
|
|
233
|
+
volume: null,
|
|
234
|
+
unitWeight: null,
|
|
235
|
+
articleWeight: null,
|
|
236
|
+
tareWeight: null,
|
|
237
|
+
supplier: null,
|
|
238
|
+
supplierCode: null,
|
|
239
|
+
supplierItemName: null,
|
|
240
|
+
htmlDescription: null,
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
count: 10,
|
|
244
|
+
total: 50,
|
|
245
|
+
page: 1,
|
|
246
|
+
totalPage: 5,
|
|
247
|
+
perPage: 10,
|
|
248
|
+
metadata: [],
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
252
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
253
|
+
});
|
|
254
|
+
const result = await service.getProductCollection(payload).toPromise();
|
|
255
|
+
expect(result?.hasSuccess).toBe(true);
|
|
256
|
+
expect(result?.response).toEqual(response);
|
|
257
|
+
});
|
|
258
|
+
it("should get product collection without payload", async () => {
|
|
259
|
+
const response = {
|
|
260
|
+
data: {
|
|
261
|
+
links: {
|
|
262
|
+
first: "/api/v1/store/product-collection?per_page=24&page=1",
|
|
263
|
+
last: "/api/v1/store/product-collection?per_page=24&page=1",
|
|
264
|
+
},
|
|
265
|
+
items: [],
|
|
266
|
+
count: 0,
|
|
267
|
+
total: 0,
|
|
268
|
+
page: 1,
|
|
269
|
+
totalPage: 1,
|
|
270
|
+
perPage: 24,
|
|
271
|
+
metadata: [],
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
275
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
276
|
+
});
|
|
277
|
+
const result = await service.getProductCollection().toPromise();
|
|
278
|
+
expect(result?.hasSuccess).toBe(true);
|
|
279
|
+
expect(result?.response).toEqual(response);
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
describe("getProductCollectionByStore", () => {
|
|
283
|
+
it("should get product collection by store successfully", async () => {
|
|
284
|
+
const storeId = "store-123";
|
|
285
|
+
const payload = {
|
|
286
|
+
page: 1,
|
|
287
|
+
per_page: 10,
|
|
288
|
+
};
|
|
289
|
+
const response = {
|
|
290
|
+
data: {
|
|
291
|
+
links: {
|
|
292
|
+
first: "/api/v1/store/product-collection?per_page=10&page=1",
|
|
293
|
+
last: "/api/v1/store/product-collection?per_page=10&page=1",
|
|
294
|
+
},
|
|
295
|
+
items: [
|
|
296
|
+
{
|
|
297
|
+
id: "1",
|
|
298
|
+
name: "Product 1",
|
|
299
|
+
barcode: "123",
|
|
300
|
+
category: "CONGELE",
|
|
301
|
+
vatInPercent: 5.5,
|
|
302
|
+
unit: "piece",
|
|
303
|
+
quantity: 1,
|
|
304
|
+
picture: "image.png",
|
|
305
|
+
slug: "product-1",
|
|
306
|
+
internalCode: "001",
|
|
307
|
+
inventory: true,
|
|
308
|
+
quantityInStock: 10,
|
|
309
|
+
minimumStockQuantity: 5,
|
|
310
|
+
pricePurchase: 10,
|
|
311
|
+
priceToSell: 15,
|
|
312
|
+
discountInPercent: 0,
|
|
313
|
+
priceAfterDiscount: 0,
|
|
314
|
+
expiryDate: null,
|
|
315
|
+
subCategory: null,
|
|
316
|
+
volume: null,
|
|
317
|
+
unitWeight: null,
|
|
318
|
+
articleWeight: null,
|
|
319
|
+
tareWeight: null,
|
|
320
|
+
supplier: null,
|
|
321
|
+
supplierCode: null,
|
|
322
|
+
supplierItemName: null,
|
|
323
|
+
htmlDescription: null,
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
count: 1,
|
|
327
|
+
total: 1,
|
|
328
|
+
page: 1,
|
|
329
|
+
totalPage: 1,
|
|
330
|
+
perPage: 10,
|
|
331
|
+
metadata: [],
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
335
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
336
|
+
});
|
|
337
|
+
const result = await service.getProductCollectionByStore(storeId, payload).toPromise();
|
|
338
|
+
expect(result?.hasSuccess).toBe(true);
|
|
339
|
+
expect(result?.response).toEqual(response);
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
describe("updateProductBatch", () => {
|
|
343
|
+
it("should update product batch successfully", async () => {
|
|
344
|
+
const storeId = "store-123";
|
|
345
|
+
const payload = {
|
|
346
|
+
products: [{ id: "1", price: 100 }],
|
|
347
|
+
};
|
|
348
|
+
const response = { data: { updated: 1 } };
|
|
349
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
350
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
351
|
+
});
|
|
352
|
+
const result = await service.updateProductBatch(storeId, payload).toPromise();
|
|
353
|
+
expect(result?.hasSuccess).toBe(true);
|
|
354
|
+
expect(result?.response).toEqual(response);
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
describe("updateCustomerBatch", () => {
|
|
358
|
+
it("should update customer batch successfully", async () => {
|
|
359
|
+
const storeId = "store-123";
|
|
360
|
+
const payload = {
|
|
361
|
+
customers: [{ id: "1", status: "active" }],
|
|
362
|
+
};
|
|
363
|
+
const response = { data: { updated: 1 } };
|
|
364
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
365
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
366
|
+
});
|
|
367
|
+
const result = await service.updateCustomerBatch(storeId, payload).toPromise();
|
|
368
|
+
expect(result?.hasSuccess).toBe(true);
|
|
369
|
+
expect(result?.response).toEqual(response);
|
|
370
|
+
});
|
|
371
|
+
});
|
|
372
|
+
describe("updateCartBatch", () => {
|
|
373
|
+
it("should update cart batch successfully", async () => {
|
|
374
|
+
const storeId = "store-123";
|
|
375
|
+
const payload = {
|
|
376
|
+
orders: [{ id: "1", status: "completed" }],
|
|
377
|
+
};
|
|
378
|
+
const response = { data: { updated: 1 } };
|
|
379
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
380
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
381
|
+
});
|
|
382
|
+
const result = await service.updateCartBatch(storeId, payload).toPromise();
|
|
383
|
+
expect(result?.hasSuccess).toBe(true);
|
|
384
|
+
expect(result?.response).toEqual(response);
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
describe("updateOrderItemBatch", () => {
|
|
388
|
+
it("should update order item batch successfully", async () => {
|
|
389
|
+
const storeId = "store-123";
|
|
390
|
+
const payload = {
|
|
391
|
+
items: [{ id: "1", quantity: 5 }],
|
|
392
|
+
};
|
|
393
|
+
const response = { data: { updated: 1 } };
|
|
394
|
+
jest.spyOn(service, "provider").mockReturnValue({
|
|
395
|
+
request: () => of(NetworkingUIEventWrapped.succeeded(response)),
|
|
396
|
+
});
|
|
397
|
+
const result = await service.updateOrderItemBatch(storeId, payload).toPromise();
|
|
398
|
+
expect(result?.hasSuccess).toBe(true);
|
|
399
|
+
expect(result?.response).toEqual(response);
|
|
400
|
+
});
|
|
401
|
+
});
|
|
402
|
+
});
|
|
@@ -53,6 +53,7 @@ export interface FeaturedProductData {
|
|
|
53
53
|
export declare class StoreService {
|
|
54
54
|
private readonly config;
|
|
55
55
|
private readonly $authToken;
|
|
56
|
+
readonly $selectedStoreId: BehaviorSubject<string | null>;
|
|
56
57
|
private readonly cacheService;
|
|
57
58
|
private readonly storeListCache;
|
|
58
59
|
private readonly productCollectionCache;
|
|
@@ -60,6 +61,14 @@ export declare class StoreService {
|
|
|
60
61
|
private readonly featuredProductCache;
|
|
61
62
|
constructor(config: NetworkingConfig, $authToken: BehaviorSubject<string | null>);
|
|
62
63
|
provider(target: StoreTarget): SmessService<StoreProvider>;
|
|
64
|
+
/**
|
|
65
|
+
* Set the selected store ID
|
|
66
|
+
*/
|
|
67
|
+
setSelectedStoreId(storeId: string | null): void;
|
|
68
|
+
/**
|
|
69
|
+
* Get the current selected store ID
|
|
70
|
+
*/
|
|
71
|
+
get currentSelectedStoreId(): string | null;
|
|
63
72
|
get(id: string): Observable<NetworkingUIEventWrapped<HttpResponse>>;
|
|
64
73
|
list(): Observable<NetworkingUIEventWrapped<HttpResponse>>;
|
|
65
74
|
productCategoryList(): Observable<NetworkingUIEventWrapped<HttpResponse>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NetworkingUIEventWrapped, } from "../types/types";
|
|
2
2
|
import { Accept, SMESSHeader, SmessService } from "./smess.service";
|
|
3
|
-
import { from, of } from "rxjs";
|
|
3
|
+
import { BehaviorSubject, from, of } from "rxjs";
|
|
4
4
|
import { map, switchMap, catchError } from "rxjs/operators";
|
|
5
5
|
import { GenericIndexedDBService } from "./cache.service";
|
|
6
6
|
export class StoreProvider {
|
|
@@ -56,6 +56,7 @@ export class StoreService {
|
|
|
56
56
|
constructor(config, $authToken) {
|
|
57
57
|
this.config = config;
|
|
58
58
|
this.$authToken = $authToken;
|
|
59
|
+
this.$selectedStoreId = new BehaviorSubject(null);
|
|
59
60
|
// Initialize cache services for different data types
|
|
60
61
|
this.cacheService = new GenericIndexedDBService("StoreCache", "id, timestamp", (data) => data, (data) => data);
|
|
61
62
|
this.storeListCache = new GenericIndexedDBService("StoreListCache", "timestamp", (data) => data, (data) => data);
|
|
@@ -67,6 +68,18 @@ export class StoreService {
|
|
|
67
68
|
const targetWrapper = new StoreProvider(this.config, target, this.$authToken);
|
|
68
69
|
return new SmessService(targetWrapper);
|
|
69
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Set the selected store ID
|
|
73
|
+
*/
|
|
74
|
+
setSelectedStoreId(storeId) {
|
|
75
|
+
this.$selectedStoreId.next(storeId);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get the current selected store ID
|
|
79
|
+
*/
|
|
80
|
+
get currentSelectedStoreId() {
|
|
81
|
+
return this.$selectedStoreId.value;
|
|
82
|
+
}
|
|
70
83
|
get(id) {
|
|
71
84
|
return from(this.cacheService.getOne(id)).pipe(switchMap((cachedData) => {
|
|
72
85
|
if (cachedData && this.isCacheValid(cachedData.timestamp)) {
|