@neutron.co.id/operasional-interfaces 1.16.1-beta.2 → 1.16.1-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,22 @@
1
1
  import { useToastStore } from "@neon.id/interfaces";
2
- import { ref } from "vue";
2
+ import { computed, ref } from "vue";
3
3
  import { ofetch } from "ofetch";
4
4
  import Papa from "papaparse";
5
5
  import { useOperasionalOfficeStore } from "../office/index.mjs";
6
6
  import { useAuthStore } from "@neon.id/identitas-interfaces";
7
+ import { useAppStore } from "@neon.id/context";
7
8
  export function useImportShift() {
8
9
  const store = useOperasionalOfficeStore();
9
10
  const toast = useToastStore();
10
11
  const authStore = useAuthStore();
12
+ const appStore = useAppStore();
13
+ const officeAppUrl = computed(() => {
14
+ if (appStore.appEnv === "dev")
15
+ return "https://dev.api.office.pendidikan.neutron.neon.id";
16
+ if (appStore.appEnv === "prod")
17
+ return "https://dev.api.office.operasional.neutron.neon.id";
18
+ return "http://localhost:7020";
19
+ });
11
20
  const loadings = ref(/* @__PURE__ */ new Set());
12
21
  const isLoading = ref(false);
13
22
  return {
@@ -20,7 +29,7 @@ export function useImportShift() {
20
29
  isLoading.value = true;
21
30
  try {
22
31
  const response = await ofetch(
23
- `${store.officeApiUrl}/downloadTemplateShift`,
32
+ `${officeAppUrl.value}/downloadTemplateShift`,
24
33
  {
25
34
  method: "GET",
26
35
  headers: {
@@ -83,7 +92,7 @@ export function useImportShift() {
83
92
  try {
84
93
  isLoading.value = true;
85
94
  const response = await ofetch(
86
- `${store.officeApiUrl}/importDataShift`,
95
+ `${officeAppUrl.value}/importDataShift`,
87
96
  {
88
97
  method: "POST",
89
98
  headers: {
@@ -12783,9 +12783,17 @@ const useOperasionalOfficeStore = pinia.defineStore(
12783
12783
  }
12784
12784
  );
12785
12785
  function useImportShift() {
12786
- const store = useOperasionalOfficeStore();
12786
+ useOperasionalOfficeStore();
12787
12787
  const toast = interfaces.useToastStore();
12788
12788
  const authStore = identitasInterfaces.useAuthStore();
12789
+ const appStore = context.useAppStore();
12790
+ const officeAppUrl = vue.computed(() => {
12791
+ if (appStore.appEnv === "dev")
12792
+ return "https://dev.api.office.pendidikan.neutron.neon.id";
12793
+ if (appStore.appEnv === "prod")
12794
+ return "https://dev.api.office.operasional.neutron.neon.id";
12795
+ return "http://localhost:7020";
12796
+ });
12789
12797
  const loadings = vue.ref(/* @__PURE__ */ new Set());
12790
12798
  const isLoading = vue.ref(false);
12791
12799
  return {
@@ -12798,7 +12806,7 @@ function useImportShift() {
12798
12806
  isLoading.value = true;
12799
12807
  try {
12800
12808
  const response = await ofetch(
12801
- `${store.officeApiUrl}/downloadTemplateShift`,
12809
+ `${officeAppUrl.value}/downloadTemplateShift`,
12802
12810
  {
12803
12811
  method: "GET",
12804
12812
  headers: {
@@ -12861,7 +12869,7 @@ function useImportShift() {
12861
12869
  try {
12862
12870
  isLoading.value = true;
12863
12871
  const response = await ofetch(
12864
- `${store.officeApiUrl}/importDataShift`,
12872
+ `${officeAppUrl.value}/importDataShift`,
12865
12873
  {
12866
12874
  method: "POST",
12867
12875
  headers: {
@@ -23,7 +23,7 @@ import "@neon.id/identitas-interfaces/fluffy.css";
23
23
  import { ComponentUtil } from "@neon.id/utils/component";
24
24
  import { OfficeInterfaces } from "@neon.id/context/helpers";
25
25
  import { useRouter, useRoute } from "vue-router";
26
- import { GraphUtil, useSingle, useCollection, NeonCollection, NeonSingle, NeonCollectionContext, usePermit, useApp, withCollection } from "@neon.id/context";
26
+ import { GraphUtil, useAppStore, useSingle, useCollection, NeonCollection, NeonSingle, NeonCollectionContext, usePermit, useApp, withCollection } from "@neon.id/context";
27
27
  import { defineStore, storeToRefs } from "pinia";
28
28
  import { models as models$2 } from "@neutron.co.id/sentral-models";
29
29
  import { useClientHandle } from "@urql/vue";
@@ -12764,9 +12764,17 @@ const useOperasionalOfficeStore = defineStore(
12764
12764
  }
12765
12765
  );
12766
12766
  function useImportShift() {
12767
- const store = useOperasionalOfficeStore();
12767
+ useOperasionalOfficeStore();
12768
12768
  const toast = useToastStore();
12769
12769
  const authStore = useAuthStore();
12770
+ const appStore = useAppStore();
12771
+ const officeAppUrl = computed(() => {
12772
+ if (appStore.appEnv === "dev")
12773
+ return "https://dev.api.office.pendidikan.neutron.neon.id";
12774
+ if (appStore.appEnv === "prod")
12775
+ return "https://dev.api.office.operasional.neutron.neon.id";
12776
+ return "http://localhost:7020";
12777
+ });
12770
12778
  const loadings = ref(/* @__PURE__ */ new Set());
12771
12779
  const isLoading = ref(false);
12772
12780
  return {
@@ -12779,7 +12787,7 @@ function useImportShift() {
12779
12787
  isLoading.value = true;
12780
12788
  try {
12781
12789
  const response = await ofetch(
12782
- `${store.officeApiUrl}/downloadTemplateShift`,
12790
+ `${officeAppUrl.value}/downloadTemplateShift`,
12783
12791
  {
12784
12792
  method: "GET",
12785
12793
  headers: {
@@ -12842,7 +12850,7 @@ function useImportShift() {
12842
12850
  try {
12843
12851
  isLoading.value = true;
12844
12852
  const response = await ofetch(
12845
- `${store.officeApiUrl}/importDataShift`,
12853
+ `${officeAppUrl.value}/importDataShift`,
12846
12854
  {
12847
12855
  method: "POST",
12848
12856
  headers: {
package/build/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "1.16.1-beta.2",
7
+ "version": "1.16.1-beta.4",
8
8
  "builder": {
9
9
  "@neon.id/module-builder": "1.8.0",
10
10
  "unbuild": "2.0.0"
package/build/nuxt.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "1.16.1-beta.2",
7
+ "version": "1.16.1-beta.4",
8
8
  "builder": {
9
9
  "@neon.id/module-builder": "1.8.0",
10
10
  "unbuild": "2.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neutron.co.id/operasional-interfaces",
3
- "version": "1.16.1-beta.2",
3
+ "version": "1.16.1-beta.4",
4
4
  "description": "Interface library of Neutron Operasional.",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -164,5 +164,5 @@
164
164
  "publishConfig": {
165
165
  "access": "public"
166
166
  },
167
- "build": 172
167
+ "build": 174
168
168
  }