This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 2d5ee547 authored by Clement Ho's avatar Clement Ho
Browse files

Replace $.ajax in project.js

parent 56e14818f2ab
/* eslint-disable func-names, space-before-function-paren, no-var, consistent-return, no-new, prefer-arrow-callback, no-return-assign, one-var, one-var-declaration-per-line, object-shorthand, no-else-return, newline-per-chained-call, no-shadow, vars-on-top, prefer-template, max-len */
import Cookies from 'js-cookie';
import { visitUrl } from '../../lib/utils/url_utility';
import { __ } from '~/locale';
import { visitUrl } from '~/lib/utils/url_utility';
import axios from '~/lib/utils/axios_utils';
import flash from '~/flash';
import projectSelect from '../../project_select';
export default class Project {
......@@ -67,17 +70,15 @@ export default class Project {
$dropdown = $(this);
selected = $'selected');
return $dropdown.glDropdown({
data: function(term, callback) {
return $.ajax({
url: $'refs-url'),
data: {
data(term, callback) {
axios.get($'refs-url'), {
params: {
ref: $'ref'),
search: term,
dataType: 'json',
}).done(function(refs) {
return callback(refs);
.then(({ data }) => callback(data))
.catch(() => flash(__('An error occurred while getting projects')));
selectable: true,
filterable: true,
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