summaryrefslogtreecommitdiff
path: root/iridescence/src/views/Admin.vue
blob: f1cf227983bd2f1d5d58dd878716f30385825408 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template>
  <div id="admin">
    <div class="container">
      <section class="section">
        <div class="columns">
          <div class="column is-narrow">
            <NewProduct></NewProduct>
          </div>
          <div class="column">
            <ProductSearch></ProductSearch>
          </div>
        </div>
        <ProductEditList></ProductEditList>
      </section>
    </div>
  </div>
</template>

<script>
import NewProduct from "@/components/admin/NewProduct.vue";
import ProductSearch from "@/components/ProductSearch.vue";
import ProductEditList from "@/components/admin/ProductEditList.vue";

export default {
  name: "Admin",
  components: {
    ProductEditList,
    NewProduct,
    ProductSearch
  },
  beforeRouteEnter: (to, from, next) => {
    fetch(process.env.VUE_APP_LOGIN_URL).then(res => {
      if (res.status == 401) {
        next(false);
      } else {
        next();
      }
    });
  }
};
</script>