|
26 | 26 | <q-btn round size="sm" color="green" icon="mdi-account-multiple" @click="fusion1(props.cols[0].value,props.cols[5].value)"> |
27 | 27 | <q-tooltip class="text-body2">fusionner les deux identités</q-tooltip> |
28 | 28 | </q-btn> |
29 | | - <q-btn round size="sm" color="green" icon="mdi-account-remove"> |
| 29 | + <q-btn round size="sm" color="green" icon="mdi-account-remove" @click="deleteDialog(props.cols[0].value,props.cols[5].value)"> |
30 | 30 | <q-tooltip class="text-body2">supprimer l'identité</q-tooltip> |
31 | 31 | </q-btn> |
32 | 32 | </template> |
|
37 | 37 | <q-btn round size="sm" color="red" icon="mdi-account-multiple" @click="fusion1(props.cols[5].value,props.cols[0].value)"> |
38 | 38 | <q-tooltip class="text-body2">fusionner les deux identités</q-tooltip> |
39 | 39 | </q-btn> |
40 | | - <q-btn round size="sm" color="red" icon="mdi-account-remove"> |
| 40 | + <q-btn round size="sm" color="red" icon="mdi-account-remove" @click="deleteDialog(props.cols[5].value,props.cols[0].value)"> |
41 | 41 | <q-tooltip class="text-body2">supprimer l'identité</q-tooltip> |
42 | 42 | </q-btn> |
43 | 43 | </template> |
@@ -106,7 +106,6 @@ const actions = { |
106 | 106 | return {...data._data?.data} |
107 | 107 | } |
108 | 108 | } |
109 | | -
|
110 | 109 | const { data: rows1, pending, error, refresh } = await useHttp('/management/identities/duplicates', { |
111 | 110 | method: 'GET', |
112 | 111 | transform: (result)=>{ |
@@ -173,6 +172,39 @@ function closeModal(){ |
173 | 172 | editForm.value=false |
174 | 173 | refresh() |
175 | 174 | } |
| 175 | +async function deleteDialog(id){ |
| 176 | + $q.dialog({ |
| 177 | + title: 'supprimer cette identité', |
| 178 | + message: 'Voulez-vous supprimer cette identité ?', |
| 179 | + persistent: true, |
| 180 | + html: true, |
| 181 | + ok: { |
| 182 | + push: true, |
| 183 | + color: 'positive', |
| 184 | + label: 'Supprimer', |
| 185 | + }, |
| 186 | + cancel: { |
| 187 | + push: true, |
| 188 | + color: 'negative', |
| 189 | + label: 'Annuler', |
| 190 | + }, |
| 191 | + }).onOk(async () => { |
| 192 | + const data=await deleteIdentity(id) |
| 193 | + refresh() |
| 194 | + }) |
| 195 | +} |
| 196 | +async function deleteIdentity(id) { |
| 197 | + await $http.post('/core/backends/delete', { |
| 198 | + method: 'POST', |
| 199 | + body: { |
| 200 | + payload: [ |
| 201 | + id, |
| 202 | + ], |
| 203 | + }, |
| 204 | + }).catch(error => { |
| 205 | + console.error('There was an error!', error); |
| 206 | + }) |
| 207 | +} |
176 | 208 | </script> |
177 | 209 | <style> |
178 | 210 | .leftid { |
|
0 commit comments