Add index to deleteFile() call, so it knows what element delete

This commit is contained in:
Ivan Nieto Vivanco 2023-01-19 13:04:49 -06:00
parent fa9116b184
commit f045008237

View file

@ -73,7 +73,7 @@
<th class="col-md-1 text-right"><span class="sr-only">{{ trans('general.actions') }}</span></th>
</tr>
<template v-for="currentFile in files">
<template v-for="(currentFile, index) in files">
<tr>
<td class="col-md-6">@{{ currentFile.file_path }}</td>
<td class="col-md-3">@{{ currentFile.created_at }} </td>
@ -84,7 +84,7 @@
<span class="sr-only">{{ trans('general.import') }}</span>
</button>
<button class="btn btn-sm btn-danger" @click="deleteFile(currentFile)">
<button class="btn btn-sm btn-danger" @click="deleteFile(currentFile, index)">
<i class="fas fa-trash icon-white" aria-hidden="true"></i><span class="sr-only"></span></button>
</td>
</tr>