MCPcopy Create free account
hub / github.com/chartbrew/chartbrew / checkForUpdates

Function checkForUpdates

client/src/modules/checkForUpdates.js:3–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { API_HOST } from "../config/settings";
2
3function checkForUpdates() {
4 const url = `${API_HOST}/update`;
5 const method = "GET";
6 const headers = new Headers({
7 "Accept": "application/json",
8 });
9
10 return fetch(url, { method, headers })
11 .then((response) => {
12 if (!response.ok) return Promise.reject(response.statusCode);
13
14 return response.json();
15 })
16 .then((data) => {
17 return data;
18 })
19 .catch((err) => {
20 return Promise.reject(err);
21 });
22}
23
24export default checkForUpdates;

Callers 1

ProjectBoardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected