first steps
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { $Fetch } from 'ofetch';
|
||||
import type { User, ConfirmResult } from '~/types/auth'
|
||||
import type { User, ConfirmResult, LoginResponse } from '~/types/auth'
|
||||
|
||||
export default class UserRepository {
|
||||
private fetcher: $Fetch;
|
||||
@@ -9,7 +9,7 @@ export default class UserRepository {
|
||||
}
|
||||
|
||||
async confirm(token: string){
|
||||
return await this.fetcher<ConfirmResult>('/auth/confirm', {
|
||||
return await this.fetcher<ConfirmResult>('/user/confirm', {
|
||||
method: 'POST',
|
||||
body: {
|
||||
token
|
||||
@@ -17,11 +17,11 @@ export default class UserRepository {
|
||||
})
|
||||
}
|
||||
|
||||
async register(email: string, password:string, locale:string){
|
||||
return await this.fetcher<ConfirmResult>('/user/register', {
|
||||
async register(email: string, password:string){
|
||||
return await this.fetcher<LoginResponse>('/auth/register', {
|
||||
method: 'POST',
|
||||
body:{
|
||||
email, password, locale
|
||||
email, password
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user