diff --git a/admin-ui/src/routes/+page.svelte b/admin-ui/src/routes/+page.svelte index e270706..6de56ba 100644 --- a/admin-ui/src/routes/+page.svelte +++ b/admin-ui/src/routes/+page.svelte @@ -1,7 +1,19 @@
@@ -19,5 +31,13 @@ {}} />
+ \ No newline at end of file diff --git a/admin-ui/src/routes/file/+page.svelte b/admin-ui/src/routes/file/+page.svelte new file mode 100644 index 0000000..e69de29 diff --git a/admin-ui/src/store/users/util/changePassword.ts b/admin-ui/src/store/users/util/changePassword.ts new file mode 100644 index 0000000..de43b89 --- /dev/null +++ b/admin-ui/src/store/users/util/changePassword.ts @@ -0,0 +1,29 @@ +import { useGraphql } from "../../utils/useGraphQl"; +import { loggedInUser } from "../../auth/store"; +import { get } from 'svelte/store'; +import { users } from "../store"; +import { User } from "../User"; + +const changePasswordMutation = ` + mutation($oldPassword: String, $newPassword: String){ + changePassword(oldPassword: $oldPassword, newPassword: $newPassword) + } +`; + +export const changePassword = async (oldPassword: string, newPassword: string) => { + let response = await useGraphql( + changePasswordMutation, + { + oldPassword, + newPassword + }, + get(loggedInUser)); + + if(response.errors) { + throw "could not change password" + } + + console.log(response) + + return true +} \ No newline at end of file