Skip to content

Instantly share code, notes, and snippets.

@c4software
Created September 1, 2019 14:32
Show Gist options
  • Select an option

  • Save c4software/8b5122405b38f4c933d6a4490f45e1ad to your computer and use it in GitHub Desktop.

Select an option

Save c4software/8b5122405b38f4c933d6a4490f45e1ad to your computer and use it in GitHub Desktop.
Les constantes
import STATUS_LIST from "constantes";
import SERVER from "constantes";
import client from "dao";
// …
if(status === STATUS_LIST.CONFIRMED){
// Code
} else if(status === STATUS_LIST.PENDING) {
// Code
}
// …
wretch(`${SERVER}/list`)
.get()
.json(json => {
// Code
})
// Voir même !
client
.getAll()
.then((liste) => {
console.log(liste);
})
// …
if(status === 300){
// Code
} else if(status === 100) {
// Code
}
// …
wretch("http://www.monapi.com/us-central/demo/v1/endpoint/client/list")
.get()
.json(json => {
// Code
})
export const MENU_API_KEY_FIREBASE = "menuApi";
export const SERVER = "http://www.monapi.com/us-central/demo/v1/endpoint/client/";
export const STATUS_LIST = {
ERROR: 0,
PENDING: 100,
VALIDATED: 200,
CONFIRMED: 300,
COOKING: 400,
READY: 500,
DELIVERING: 600,
DELIVERED: 700,
CLOSED: 800,
CANCELLED: 1000,
};
export const ACL = {
ADMIN: "admin",
ZONES: "zones",
SYSTEMTIMES: "systemTimes",
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment