(user: IUser, currentPassword: string)
| 9 | } |
| 10 | |
| 11 | export async function create(user: IUser, currentPassword: string) { |
| 12 | const res = await fetchURL(`/api/users`, { |
| 13 | method: "POST", |
| 14 | body: JSON.stringify({ |
| 15 | what: "user", |
| 16 | which: [], |
| 17 | current_password: currentPassword, |
| 18 | data: user, |
| 19 | }), |
| 20 | }); |
| 21 | |
| 22 | if (res.status === 201) { |
| 23 | return res.headers.get("Location"); |
| 24 | } |
| 25 | |
| 26 | throw new StatusError(await res.text(), res.status); |
| 27 | } |
| 28 | |
| 29 | export async function update( |
| 30 | user: Partial<IUser>, |
nothing calls this directly
no test coverage detected