Homepage, lepsi POI

This commit is contained in:
Michal Kváček
2023-08-23 21:40:32 +02:00
parent 8c3b8d19dd
commit 19b078b43c
33 changed files with 370 additions and 141 deletions
+13
View File
@@ -0,0 +1,13 @@
export const updateInItems = (items, key, data) => {
const idx = items.findIndex(i => i[key] === data[key]);
if (idx >= 0)
items[idx] = data;
else items.push(data);
}
export const deleteFromItems = (items, key, value) => {
const idx = items.findIndex(a => a[key] === value);
if (idx < 0) return;
items.splice(idx, 1);
}