mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
improved /user/update
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export * as issue from "./issue";
|
||||
export * as organisation from "./organisation";
|
||||
export * as project from "./project";
|
||||
export * as user from "./user";
|
||||
|
||||
export type ServerQueryInput = {
|
||||
onSuccess?: (data: any, res: Response) => void;
|
||||
|
||||
@@ -5,20 +5,17 @@ export async function update({
|
||||
id,
|
||||
name,
|
||||
password,
|
||||
serverURL,
|
||||
onSuccess,
|
||||
onError,
|
||||
}: {
|
||||
id: number;
|
||||
name: string;
|
||||
password: string;
|
||||
serverURL: string;
|
||||
} & ServerQueryInput) {
|
||||
const url = new URL(`${getServerURL()}/user/update`);
|
||||
url.searchParams.set("id", `${id}`);
|
||||
url.searchParams.set("name", name.trim());
|
||||
url.searchParams.set("password", password.trim());
|
||||
url.searchParams.set("serverURL", serverURL.trim());
|
||||
|
||||
const res = await fetch(url.toString(), {
|
||||
headers: getAuthHeaders(),
|
||||
|
||||
Reference in New Issue
Block a user