Commit 54ca6190 authored by Ege Kızıltan's avatar Ege Kızıltan Committed by Paul Slaughter

Update fetchSortedData in alerts_list.vue

- https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82212
parent d0a3544b
...@@ -15,7 +15,7 @@ import { ...@@ -15,7 +15,7 @@ import {
import produce from 'immer'; import produce from 'immer';
import { n__ } from '~/locale'; import { n__ } from '~/locale';
import getAlertsQuery from '~/graphql_shared/queries/get_alerts.query.graphql'; import getAlertsQuery from '~/graphql_shared/queries/get_alerts.query.graphql';
import { convertToSnakeCase } from '~/lib/utils/text_utility'; import { sortObjectToString } from '~/lib/utils/table_utility';
import { joinPaths } from '~/lib/utils/url_utility'; import { joinPaths } from '~/lib/utils/url_utility';
import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue';
import { PAGE_SIZE } from 'ee/threat_monitoring/constants'; import { PAGE_SIZE } from 'ee/threat_monitoring/constants';
...@@ -138,10 +138,7 @@ export default { ...@@ -138,10 +138,7 @@ export default {
} }
}, },
fetchSortedData({ sortBy, sortDesc }) { fetchSortedData({ sortBy, sortDesc }) {
const sortingDirection = sortDesc ? 'DESC' : 'ASC'; this.sort = sortObjectToString({ sortBy, sortDesc });
const sortingColumn = convertToSnakeCase(sortBy).toUpperCase();
this.sort = `${sortingColumn}_${sortingDirection}`;
}, },
getIssueState({ issue: { state } }) { getIssueState({ issue: { state } }) {
return state === 'closed' ? `(${this.$options.i18n.CLOSED})` : ''; return state === 'closed' ? `(${this.$options.i18n.CLOSED})` : '';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment