This repository has been archived on 2026-10-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
a_sink_repair/scripts/dataAccess.js
T
2021-11-03 14:58:45 -05:00

18 lines
563 B
JavaScript

const API = "http://localhost:8088"
export const fetchRequests = () => {
return fetch(`${API}/requests`)
.then(response => response.json())
.then(
(serviceRequests) => {
// Store the external state in application state
applicationState.requests = serviceRequests
}
)
}
export const getRequests = () => {
return database.serviceRequest.map(serviceRequest => ({...serviceRequest}))
}
// Need copies of permanent state set as empty arrays, matching the keys in your JSON file