mirror of
https://github.com/dsoaress/link-free.git
synced 2026-08-17 06:56:04 +01:00
refactor: data format
This commit is contained in:
12
src/utils/retrieveUser.ts
Normal file
12
src/utils/retrieveUser.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { User } from '@prisma/client'
|
||||
|
||||
import { api } from '../services/api'
|
||||
|
||||
export async function retrieveUser() {
|
||||
try {
|
||||
const { data } = await api.get<Omit<User, 'password'>>('users/me')
|
||||
return data
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user