changes to UI mostly

This commit is contained in:
Simon Pocrnjič
2025-09-30 22:00:03 +02:00
parent 53917f2ca0
commit db99a57030
18 changed files with 2169 additions and 777 deletions
@@ -94,10 +94,21 @@ const storeOrUpdate = () => {
},
preserveScroll: true,
}
const params = {}
try {
const url = new URL(window.location.href)
const seg = url.searchParams.get('segment')
if (seg) params.segment = seg
} catch (e) {}
if (isEdit) {
formContract.put(route('clientCase.contract.update', { client_case: props.client_case.uuid, uuid: formContract.uuid }), options)
formContract.put(route('clientCase.contract.update', { client_case: props.client_case.uuid, uuid: formContract.uuid, ...params }), options)
} else {
formContract.post(route('clientCase.contract.store', props.client_case), options)
// route helper merges params for GET; for POST we can append query manually if needed
let postUrl = route('clientCase.contract.store', props.client_case)
if (params.segment) {
postUrl += (postUrl.includes('?') ? '&' : '?') + 'segment=' + encodeURIComponent(params.segment)
}
formContract.post(postUrl, options)
}
}