debian-mirror-gitlab/app/assets/javascripts/feature_highlight/feature_highlight_helper.js
2023-05-27 22:25:52 +05:30

19 lines
545 B
JavaScript

import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';
import { __ } from '~/locale';
export const getSelector = (highlightId) => `.js-feature-highlight[data-highlight=${highlightId}]`;
export function dismiss(endpoint, highlightId) {
return axios
.post(endpoint, {
feature_name: highlightId,
})
.catch(() =>
createAlert({
message: __(
'An error occurred while dismissing the feature highlight. Refresh the page and try dismissing again.',
),
}),
);
}