fix: refs #7356 transfer ticket method
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-10-01 15:12:22 +02:00
parent ea7c799909
commit 2ca99a51ae
2 changed files with 8 additions and 7 deletions

View File

@ -277,13 +277,14 @@ async function createRefund(withWarehouse) {
const params = { const params = {
ticketsIds: [parseInt(ticketId)], ticketsIds: [parseInt(ticketId)],
withWarehouse: withWarehouse, withWarehouse: withWarehouse,
negative: true,
}; };
const { data } = await axios.post(`Tickets/refund`, params); const { data } = await axios.post(`Tickets/cloneAll`, params);
if (data) { if (data) {
const refundTicket = data; const [refundTicket] = data;
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
push({ name: 'TicketSale', params: { id: refundTicket[0].id } }); push({ name: 'TicketSale', params: { id: refundTicket.id } });
} }
} }

View File

@ -44,7 +44,7 @@ const props = defineProps({
}, },
}); });
const router = useRouter(); const { push } = useRouter();
const { t } = useI18n(); const { t } = useI18n();
const { dialog } = useQuasar(); const { dialog } = useQuasar();
const { notify } = useNotify(); const { notify } = useNotify();
@ -142,7 +142,7 @@ const onCreateClaimAccepted = async () => {
try { try {
const params = { ticketId: ticket.value.id, sales: props.sales }; const params = { ticketId: ticket.value.id, sales: props.sales };
const { data } = await axios.post(`Claims/createFromSales`, params); const { data } = await axios.post(`Claims/createFromSales`, params);
router.push({ name: 'ClaimBasicData', params: { id: data.id } }); push({ name: 'ClaimBasicData', params: { id: data.id } });
} catch (error) { } catch (error) {
console.error('Error creating claim: ', error); console.error('Error creating claim: ', error);
} }
@ -169,7 +169,7 @@ const createRefund = async (withWarehouse) => {
const { data } = await axios.post('Tickets/cloneAll', params); const { data } = await axios.post('Tickets/cloneAll', params);
const [refundTicket] = data; const [refundTicket] = data;
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive'); notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
router.push({ name: 'TicketSale', params: { id: refundTicket.id } }); push({ name: 'TicketSale', params: { id: refundTicket.id } });
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }