feat(dashboard, medusa) add metadata to pages (#9433)
**WIP** - add metadata component and edit route to missing pages - fix API issues around metadata in certain domains --- FIXES CC-554
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export { UserMetadata as Component } from "./user-metadata"
|
||||
@@ -0,0 +1,27 @@
|
||||
import { useParams } from "react-router-dom"
|
||||
|
||||
import { MetadataForm } from "../../../components/forms/metadata-form"
|
||||
import { RouteDrawer } from "../../../components/modals"
|
||||
import { useUpdateUser, useUser } from "../../../hooks/api"
|
||||
|
||||
export const UserMetadata = () => {
|
||||
const { id } = useParams()
|
||||
|
||||
const { user, isPending, isError, error } = useUser(id)
|
||||
const { mutateAsync, isPending: isMutating } = useUpdateUser(id)
|
||||
|
||||
if (isError) {
|
||||
throw error
|
||||
}
|
||||
|
||||
return (
|
||||
<RouteDrawer>
|
||||
<MetadataForm
|
||||
isPending={isPending}
|
||||
isMutating={isMutating}
|
||||
hook={mutateAsync}
|
||||
metadata={user?.metadata}
|
||||
/>
|
||||
</RouteDrawer>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user