api modifs

This commit is contained in:
Ayush Kumar Sinha 2019-07-20 16:14:09 +05:30
parent 7f1457076c
commit 2b677d9d57

View File

@ -34,6 +34,15 @@ export const fetchBuilds = async str => {
return data.builds;
};
export const fetchBuilders = async () => {
const response = await fetch('/api/builders');
const data = await response.json();
if (response.status >= 400) {
throw new Error(data.errors);
}
return data;
};
export const fetchBranches = async () => {
const response = await fetch('/api/branches');
const data = await response.json();