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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user