Skip to content
Snippets Groups Projects
Commit 29da03fe authored by Erik Borgeteien Hansen's avatar Erik Borgeteien Hansen
Browse files

add null handling and debug print

parent b2207f5f
No related branches found
No related tags found
1 merge request!128Admin page guard
import axios from "axios";
import { tokenHeader } from "./token-utils";
import UserService from "@/services/user.service";
import { isArray } from "core-js/core/array";
const API_URL = process.env.VUE_APP_BASEURL;
async function addAdmins() {
const adminList = await UserService.getAdminList();
if (!isArray(adminList)) return [];
console.log(adminList);
if (!Array.isArray(adminList)) return [];
for (let i = 0; i < adminList.length; i++) {
this.$store.commit("addAdmin", adminList[i]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment