Skip to content

Commit b3abf6e

Browse files
committed
Merge branch '4.1' into 'main'
2 parents 3b535a3 + 5eae2ea commit b3abf6e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

phpmyfaq/admin/assets/src/content/glossary.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import { createGlossary, deleteGlossary, getGlossary, updateGlossary } from '../api';
1717
import { addElement, pushNotification } from '../../../../assets/src/utils';
18-
import bootstrap, { Modal } from 'bootstrap';
18+
import { Modal } from 'bootstrap';
1919

2020
export const handleDeleteGlossary = (): void => {
2121
const deleteButtons: NodeListOf<HTMLButtonElement> = document.querySelectorAll('.pmf-admin-delete-glossary');
@@ -58,8 +58,8 @@ export const handleAddGlossary = (): void => {
5858
if (response) {
5959
if (modal) {
6060
// Close modal properly using Bootstrap
61-
const bootstrapModal = bootstrap.Modal.getInstance(modal) as Modal;
62-
bootstrapModal.hide();
61+
const bootstrapModal = Modal.getInstance(modal);
62+
bootstrapModal?.hide();
6363

6464
// Reset form fields for the next entry
6565
(document.getElementById('item') as HTMLInputElement).value = '';
@@ -148,8 +148,8 @@ export const handleUpdateGlossary = (): void => {
148148
if (response) {
149149
if (modal) {
150150
// Close modal properly using Bootstrap
151-
const bootstrapModal = bootstrap.Modal.getInstance(modal) as Modal;
152-
bootstrapModal.hide();
151+
const bootstrapModal = Modal.getInstance(modal);
152+
bootstrapModal?.hide();
153153
}
154154

155155
const itemLink = document.querySelector(

0 commit comments

Comments
 (0)