Skip to content
Snippets Groups Projects

Add ability to clean up stale environments

Merged Allen Cook requested to merge 19724-ui-stop-stale-environments into master
13 files
+ 250
3
Compare changes
  • Side-by-side
  • Inline
Files
13
+ 21
0
import { DEFAULT_PER_PAGE } from '~/api';
import axios from '../lib/utils/axios_utils';
import { buildApiUrl } from './api_utils';
const STOP_STALE_ENVIRONMENTS_PATH =
'/api/:version/projects/:id/environments/stop_stale?before=:before';
export function stopStaleEnvironments(projectId, before, query, options) {
const url = buildApiUrl(STOP_STALE_ENVIRONMENTS_PATH)
.replace(':id', projectId)
.replace(':before', before.toISOString());
const defaults = {
search: query,
per_page: DEFAULT_PER_PAGE,
simple: true,
};
return axios.post(url, {
params: Object.assign(defaults, options),
});
}
Loading