feat: Add "Save & Close" button in InterestDetailsModal, enhance saveInterest function to conditionally close modal, and improve logging in delete-generated-document and get-expenses APIs

This commit is contained in:
2025-07-10 17:36:10 -04:00
parent 6ebe96bbf4
commit 242e33f7b9
5 changed files with 80 additions and 8 deletions

View File

@@ -75,6 +75,18 @@
<v-icon start>mdi-content-save</v-icon>
Save Changes
</v-btn>
<v-btn
variant="outlined"
color="success"
size="large"
@click="() => saveInterest(false, true)"
:loading="isSaving"
:disabled="isSaving || isDeleting"
class="ml-2"
>
<v-icon start>mdi-content-save-move</v-icon>
Save & Close
</v-btn>
</v-toolbar-items>
</v-toolbar>
@@ -848,7 +860,7 @@ const handleFormSubmit = () => {
}
};
const saveInterest = async (isAutoSave = false) => {
const saveInterest = async (isAutoSave = false, closeAfterSave = false) => {
if (interest.value) {
isSaving.value = true;
try {
@@ -871,7 +883,11 @@ const saveInterest = async (isAutoSave = false) => {
if (!isAutoSave) {
toast.success("Interest saved successfully!");
emit("save", interest.value);
closeModal();
// Only close if explicitly requested
if (closeAfterSave) {
closeModal();
}
} else {
// For auto-save, just emit save to refresh parent
emit("save", interest.value);