Compare commits
No commits in common. "ddf9a0ddeadf349d4365d5e2569b8727ea5701c3" and "ff5e5dec14186daa4be1bd81e9d0bf2e683164c1" have entirely different histories.
ddf9a0ddea
...
ff5e5dec14
|
@ -1,53 +1,11 @@
|
||||||
import type {DataProvider, UpdateParams, UpdateResponse, HttpError} from "@refinedev/core";
|
import type { DataProvider } from "@refinedev/core";
|
||||||
import {SdkProvider} from "~/data/sdk-provider.js";
|
import {SdkProvider} from "~/data/sdk-provider.js";
|
||||||
|
|
||||||
type AccountParams = {
|
|
||||||
email?: string;
|
|
||||||
password?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type AccountData = AccountParams;
|
|
||||||
|
|
||||||
export const accountProvider: SdkProvider = {
|
export const accountProvider: SdkProvider = {
|
||||||
getList: () => {
|
getList: () => { throw Error("Not Implemented") },
|
||||||
throw Error("Not Implemented")
|
getOne: () => { throw Error("Not Implemented") },
|
||||||
},
|
update: () => { throw Error("Not Implemented") },
|
||||||
getOne: () => {
|
create: () => { throw Error("Not Implemented") },
|
||||||
throw Error("Not Implemented")
|
deleteOne: () => { throw Error("Not Implemented") },
|
||||||
},
|
getApiUrl: () => "",
|
||||||
// @ts-ignore
|
|
||||||
async update<TVariables extends AccountParams = AccountParams>(
|
|
||||||
params: UpdateParams<AccountParams>,
|
|
||||||
): Promise<UpdateResponse<AccountData>> {
|
|
||||||
if (params.variables.email && params.variables.password) {
|
|
||||||
const ret = accountProvider.sdk?.account().updateEmail(params.variables.email, params.variables.password);
|
|
||||||
|
|
||||||
if (ret) {
|
|
||||||
if (ret instanceof Error) {
|
|
||||||
return Promise.reject(ret)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return Promise.reject();
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
data:
|
|
||||||
{
|
|
||||||
email: params.variables.email,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return an empty response if params.variables is undefined
|
|
||||||
return {
|
|
||||||
data: {} as AccountParams,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
create: () => {
|
|
||||||
throw Error("Not Implemented")
|
|
||||||
},
|
|
||||||
deleteOne: () => {
|
|
||||||
throw Error("Not Implemented")
|
|
||||||
},
|
|
||||||
getApiUrl: () => "",
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,8 +222,8 @@ const ChangeEmailForm = ({
|
||||||
const data = Object.fromEntries(new FormData(e.currentTarget).entries());
|
const data = Object.fromEntries(new FormData(e.currentTarget).entries());
|
||||||
console.log(identity);
|
console.log(identity);
|
||||||
updateEmail({
|
updateEmail({
|
||||||
resource: "account",
|
resource: "users",
|
||||||
id: "",
|
id: identity?.id || "",
|
||||||
values: {
|
values: {
|
||||||
email: data.email.toString(),
|
email: data.email.toString(),
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
"@conform-to/react": "^1.0.2",
|
"@conform-to/react": "^1.0.2",
|
||||||
"@conform-to/zod": "^1.0.2",
|
"@conform-to/zod": "^1.0.2",
|
||||||
"@fontsource-variable/manrope": "^5.0.19",
|
"@fontsource-variable/manrope": "^5.0.19",
|
||||||
"@lumeweb/portal-sdk": "0.0.0-20240319120038",
|
"@lumeweb/portal-sdk": "0.0.0-20240318224232",
|
||||||
"@radix-ui/react-avatar": "^1.0.4",
|
"@radix-ui/react-avatar": "^1.0.4",
|
||||||
"@radix-ui/react-checkbox": "^1.0.4",
|
"@radix-ui/react-checkbox": "^1.0.4",
|
||||||
"@radix-ui/react-dialog": "^1.0.5",
|
"@radix-ui/react-dialog": "^1.0.5",
|
||||||
|
|
Loading…
Reference in New Issue