orders.js 748 B

12345678910111213141516171819202122232425
  1. window.ordersStrandObj = {
  2. isPopulated: false,
  3. display: function(){
  4. if(!this.isPopulated){
  5. fetch("/orders", {
  6. method: "GET",
  7. headers: {
  8. "Content-Type": "application/json;charset=utf-8"
  9. },
  10. })
  11. .then((response) => response.json())
  12. .then((response)=>{
  13. if(typeof(response) === "string"){
  14. banner.createError(response);
  15. }else{
  16. }
  17. })
  18. .catch((err)=>{
  19. banner.createError("Unable to retrieve your orders at the moment");
  20. });
  21. }
  22. }
  23. }