Browse Source

fix: punishment disable button was not disabled even after punishment expired

Kristian Vos 2 years ago
parent
commit
cffc45d376
1 changed files with 6 additions and 4 deletions
  1. 6 4
      frontend/src/pages/Admin/Users/Punishments.vue

+ 6 - 4
frontend/src/pages/Admin/Users/Punishments.vue

@@ -29,7 +29,7 @@ const columns = ref(<TableColumn[]>[
 	{
 	{
 		name: "options",
 		name: "options",
 		displayName: "Options",
 		displayName: "Options",
-		properties: ["_id", "active", "status"],
+		properties: ["_id", "status"],
 		sortable: false,
 		sortable: false,
 		hidable: false,
 		hidable: false,
 		resizable: false,
 		resizable: false,
@@ -227,18 +227,20 @@ const deactivatePunishment = punishmentId => {
 					<quick-confirm
 					<quick-confirm
 						@confirm="deactivatePunishment(slotProps.item._id)"
 						@confirm="deactivatePunishment(slotProps.item._id)"
 						:disabled="
 						:disabled="
-							!slotProps.item.active || slotProps.item.removed
+							slotProps.item.status === 'Inactive' ||
+							slotProps.item.removed
 						"
 						"
 					>
 					>
 						<button
 						<button
 							class="button is-danger icon-with-button material-icons"
 							class="button is-danger icon-with-button material-icons"
 							:class="{
 							:class="{
 								disabled:
 								disabled:
-									!slotProps.item.active ||
+									slotProps.item.status === 'Inactive' ||
 									slotProps.item.removed
 									slotProps.item.removed
 							}"
 							}"
 							:disabled="
 							:disabled="
-								!slotProps.item.active || slotProps.item.removed
+								slotProps.item.status === 'Inactive' ||
+								slotProps.item.removed
 							"
 							"
 							content="Deactivate Punishment"
 							content="Deactivate Punishment"
 							v-tippy
 							v-tippy