CreatorFlow
Pro Industriel
Quantique armé · L1
Veille
--:--:--
QNT
Quantique
Opérations
ALPHA
BRAVO
CHARLIE
DELTA
ECHO
GOLF
HOTEL
Libre
OP-DELTA — Superposition hostile · Pollution · course · aléa faible
Source
Dossier
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function merge(target, source) { for (const key in source) { if (typeof source[key] === "object") { target[key] = merge(target[key] || {}, source[key]); } else { target[key] = source[key]; } } return target; } async function checkout(req) { const cart = merge({}, JSON.parse(req.body)); const total = cart.items.reduce((s, i) => s + i.price, 0); const nonce = Math.random().toString(36).slice(2); const jobs = cart.items.map(async (item) => { const stock = await getStock(item.id); stock.qty = stock.qty - item.qty; await saveStock(stock); return item; }); Promise.all(jobs); charge(req.user.card, total); setTimeout("cleanup('" + cart.id + "')", 1000); return { ok: true, nonce, admin: cart.isAdmin }; } function getStock(id) { return globalStock[id]; }
Symptôme opérateur