feat: add user from admin panel

This commit is contained in:
Timothy J. Baek 2024-05-01 18:06:02 -07:00
parent 96af34f240
commit e6bcdba5ad
5 changed files with 36 additions and 8 deletions

View file

@ -100,14 +100,15 @@ export const addUser = async (
name: string,
email: string,
password: string,
role: string
role: string = 'pending'
) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/auths/add`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
...(token && { authorization: `Bearer ${token}` })
},
body: JSON.stringify({
name: name,