Template
chore: formatting
This commit is contained in:
+5
-4
@@ -1,5 +1,6 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { UserResponseDTO } from "~/netcode/events/dto/userresponse.dto";
|
||||
import { type FetchContext } from "ofetch";
|
||||
|
||||
export const useUserStore = defineStore("user", {
|
||||
state: () => ({
|
||||
@@ -18,7 +19,7 @@ export const useUserStore = defineStore("user", {
|
||||
{
|
||||
credentials: "include",
|
||||
immediate: true,
|
||||
}
|
||||
},
|
||||
);
|
||||
if (data.data.value) {
|
||||
this.users[data.data.value.id] = data.data.value;
|
||||
@@ -33,15 +34,15 @@ export const useUserStore = defineStore("user", {
|
||||
credentials: "include",
|
||||
server: false,
|
||||
immediate: true,
|
||||
onResponse: (data) => {
|
||||
if (data.response.ok) {
|
||||
onResponse: (data: FetchContext<UserResponseDTO>) => {
|
||||
if (data.response && data.response.ok && data.response._data) {
|
||||
this.self = data.response._data;
|
||||
}
|
||||
|
||||
this.has_contacted = true;
|
||||
},
|
||||
lazy: true,
|
||||
}
|
||||
},
|
||||
);
|
||||
return req;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user