feat: /objednani – skupinové objednávky s QR platbou #55
@@ -56,18 +56,16 @@ export default function EditGroupFeesModal({ isOpen, onClose, group, onSaved }:
|
|||||||
setError(null);
|
setError(null);
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const body: Record<string, any> = { id: group.id };
|
const res = await updateGroupFees({
|
||||||
body.fees = feesNum;
|
body: {
|
||||||
body.shipping = shippingNum;
|
id: group.id,
|
||||||
body.tip = tipNum;
|
fees: feesNum,
|
||||||
if (discountNum > 0) {
|
shipping: shippingNum,
|
||||||
body.discountType = discountType;
|
tip: tipNum,
|
||||||
body.discountValue = discountNum;
|
discountType: discountNum > 0 ? discountType : undefined,
|
||||||
} else {
|
discountValue: discountNum > 0 ? discountNum : undefined,
|
||||||
body.discountType = '';
|
},
|
||||||
body.discountValue = 0;
|
});
|
||||||
}
|
|
||||||
const res = await updateGroupFees({ body });
|
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
setError((res.error as any).error || 'Nastala chyba');
|
setError((res.error as any).error || 'Nastala chyba');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -32,5 +32,6 @@ export const getWebsocket = () => io;
|
|||||||
|
|
||||||
/** Pošle event konkrétnímu přihlášenému uživateli (pokud je připojen). */
|
/** Pošle event konkrétnímu přihlášenému uživateli (pokud je připojen). */
|
||||||
export const emitToUser = (login: string, event: string, data: unknown) => {
|
export const emitToUser = (login: string, event: string, data: unknown) => {
|
||||||
|
if (!io) return;
|
||||||
io.to(`user:${login}`).emit(event, data);
|
io.to(`user:${login}`).emit(event, data);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user