Do not use a store for API
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { StorageSerializers, useStorage } from '@vueuse/core';
|
||||
import { defineStore } from 'pinia'
|
||||
import { useAPI } from './api';
|
||||
import { POST } from '../api';
|
||||
|
||||
interface State {
|
||||
Session: Session | null
|
||||
@ -40,14 +40,12 @@ export const useSessionStore = defineStore('session', {
|
||||
this.Budgets = x.Budgets;
|
||||
},
|
||||
async login(login: any) {
|
||||
const api = useAPI();
|
||||
const response = await api.POST("/user/login", JSON.stringify(login));
|
||||
const response = await POST("/user/login", JSON.stringify(login));
|
||||
const result = await response.json();
|
||||
return this.loginSuccess(result);
|
||||
},
|
||||
async register(login : any) {
|
||||
const api = useAPI();
|
||||
const response = await api.POST("/user/register", JSON.stringify(login));
|
||||
const response = await POST("/user/register", JSON.stringify(login));
|
||||
const result = await response.json();
|
||||
return this.loginSuccess(result);
|
||||
},
|
||||
|
Reference in New Issue
Block a user