stats.ts 515 B

1234567891011121314151617181920212223
  1. import { makeGetRequest } from '../requests/requests'
  2. import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
  3. function getStats (url: string, useCache = false) {
  4. const path = '/api/v1/server/stats'
  5. const query = {
  6. t: useCache ? undefined : new Date().getTime()
  7. }
  8. return makeGetRequest({
  9. url,
  10. path,
  11. query,
  12. statusCodeExpected: HttpStatusCode.OK_200
  13. })
  14. }
  15. // ---------------------------------------------------------------------------
  16. export {
  17. getStats
  18. }