19 lines
549 B
JavaScript
19 lines
549 B
JavaScript
import { deprecatedCreateFlash as Flash } from '~/flash';
|
|
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(() =>
|
|
Flash(
|
|
__(
|
|
'An error occurred while dismissing the feature highlight. Refresh the page and try dismissing again.',
|
|
),
|
|
),
|
|
);
|
|
}
|