Skip to content

Commit

Permalink
api: Remove unused Axios API calls
Browse files Browse the repository at this point in the history
This removes Axios API calls which were replaced by RTK Query.
  • Loading branch information
regexowl committed Dec 12, 2023
1 parent 79a0060 commit e7dee1e
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,6 @@ import { CONTENT_SOURCES_API, IMAGE_BUILDER_API } from './constants';

const postHeaders = { headers: { 'Content-Type': 'application/json' } };

async function composeImage(body) {
const path = '/compose';
const request = await axios.post(
IMAGE_BUILDER_API.concat(path),
body,
postHeaders
);
return request.data;
}

async function getComposes(limit, offset) {
const params = new URLSearchParams({
limit,
offset,
});
const path = '/composes?' + params.toString();
const request = await axios.get(IMAGE_BUILDER_API.concat(path));
return request.data;
}

async function getComposeStatus(id) {
const path = '/composes/' + id;
const request = await axios.get(IMAGE_BUILDER_API.concat(path));
return request.data;
}

async function getPackages(distribution, architecture, search, limit) {
const params = new URLSearchParams({
distribution,
Expand Down Expand Up @@ -69,40 +43,7 @@ async function getVersion() {
return request.data;
}

// get clones of a compose
async function getClones(id, limit, offset) {
const params = new URLSearchParams({
limit,
offset,
});
const path = `/composes/${id}/clones?${params}`;
const request = await axios.get(IMAGE_BUILDER_API.concat(path));
return request.data;
}

async function getCloneStatus(id) {
const path = `/clones/${id}`;
const request = await axios.get(IMAGE_BUILDER_API.concat(path));
return request.data;
}

async function cloneImage(composeId, body) {
const path = `/composes/${composeId}/clone`;
const request = await axios.post(
IMAGE_BUILDER_API.concat(path),
body,
postHeaders
);
return request.data;
}

const apiCalls = {
cloneImage,
composeImage,
getClones,
getCloneStatus,
getComposes,
getComposeStatus,
getPackages,
getPackagesContentSources,
getVersion,
Expand Down

0 comments on commit e7dee1e

Please sign in to comment.