feat: credit note => remove attachment on create

This commit is contained in:
puriphatt 2025-01-14 11:40:55 +07:00
parent c5d3897d76
commit 1cdc2bd4cc
2 changed files with 8 additions and 4 deletions

View file

@ -75,7 +75,7 @@ onMounted(() => {
color="positive"
size="1rem"
/>
{{ idle ? '' : progress !== 1 ? `Uploading...` : 'Completed' }}
{{ idle ? `Pending` : progress !== 1 ? `Uploading...` : 'Completed' }}
</span>
</article>
<q-btn

View file

@ -668,12 +668,12 @@ onMounted(async () => {
attachmentList = f;
attachmentData = [];
Array.from(f).forEach(({ name }) => {
Array.from(f).forEach((el) => {
attachmentData.push({
name: name,
name: el.name,
progress: 1,
loaded: 0,
total: 0,
total: el.size,
placeholder: true,
});
});
@ -685,6 +685,10 @@ onMounted(async () => {
"
@remove="
async (n) => {
const attIndex = attachmentData.findIndex((v) => v.name === n);
attachmentData.splice(attIndex, 1);
if (!creditNoteData) return;
await remove(creditNoteData.id, n);
}