Skip to content

Commit

Permalink
fix: lint fix #356
Browse files Browse the repository at this point in the history
  • Loading branch information
bsilkyn committed May 15, 2024
1 parent e75e008 commit 7e2bdea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
13 changes: 10 additions & 3 deletions frontend/src/composables/services/docker.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { Response } from '@/types/Response.ts';
import { endpoints } from '@/config/endpoints.ts';
import { type Ref, ref } from 'vue';
import { type Filter } from '@/types/filter/Filter.ts';
import { create, getList, getPaginatedList, patch, deleteId, deleteIdWithData } from '@/composables/services/helpers.ts';
import {
create,
getList,
getPaginatedList,
patch,
deleteId,
deleteIdWithData,
} from '@/composables/services/helpers.ts';
import { type PaginatorResponse } from '@/types/filter/Paginator.ts';

interface DockerImagesState {
Expand Down Expand Up @@ -60,7 +67,7 @@ export function useDockerImages(): DockerImagesState {

async function deleteDockerImages(ids: string[]): Promise<void> {
const endpoint = endpoints.dockerImages.deleteMany;
const data = { 'ids': ids }
const data = { ids };
await deleteIdWithData<Response>(endpoint, data, response, Response.fromJSON);
}

Expand All @@ -74,6 +81,6 @@ export function useDockerImages(): DockerImagesState {
patchDockerImage,
createDockerImage,
deleteDockerImage,
deleteDockerImages
deleteDockerImages,
};
}
2 changes: 1 addition & 1 deletion frontend/src/config/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const endpoints = {
retrieve: '/api/docker-images/{id}/',
search: '/api/docker-images/search/',
patch: '/api/docker-images/{id}/public/',
deleteMany: '/api/docker-images/delete/'
deleteMany: '/api/docker-images/delete/',
},
students: {
index: '/api/students/',
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/views/admin/DockerImagesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import LazyDataTable from '@/components/admin/LazyDataTable.vue';
import { useDockerImages } from '@/composables/services/docker.service.ts';
import { useFilter } from '@/composables/filters/filter.ts';
import { useI18n } from 'vue-i18n';
import { computed, ref} from 'vue';
import { computed, ref } from 'vue';
import { useRoute } from 'vue-router';
import { DockerImage } from '@/types/DockerImage.ts';
import { getDockerImageFilters } from '@/types/filter/Filter.ts';
Expand All @@ -31,7 +31,7 @@ const {
patchDockerImage,
createDockerImage,
deleteDockerImage,
deleteDockerImages
deleteDockerImages,
} = useDockerImages();
const { filter, onFilter } = useFilter(getDockerImageFilters(query));
Expand Down Expand Up @@ -108,7 +108,7 @@ const toggleSafetyGuardMultiRemove = (): void => {
showSafetyGuard.value = true;
};
const removeItems = async (): Promise<void> => {
const ids = selectedItems.value?.map(item => item.id) ?? []
const ids = selectedItems.value?.map((item) => item.id) ?? [];
await deleteDockerImages(ids);
selectedItems.value = [];
};
Expand All @@ -123,7 +123,6 @@ const upload = async (event: FileUploadUploaderEvent): Promise<void> => {
selectedOption.value = selectOptions.value[0];
};
/**
* A function to be triggered when (an) item(s) are selected, and changes the multiRemove Button's disabled status
* accordingly.
Expand Down

0 comments on commit 7e2bdea

Please sign in to comment.