mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: update front layout
This commit is contained in:
18
assets/utils/api/user.ts
Normal file
18
assets/utils/api/user.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import {request, User} from "./index";
|
||||
|
||||
|
||||
export async function login(email: string, password: string): Promise<boolean> {
|
||||
const response = await request({
|
||||
method: 'POST',
|
||||
url: 'login',
|
||||
data: {email, password}
|
||||
})
|
||||
return response.status === 200
|
||||
}
|
||||
|
||||
export async function getUser(): Promise<User> {
|
||||
const response = await request<User>({
|
||||
url: 'me'
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
Reference in New Issue
Block a user