rht
This commit is contained in:
parent
d9fcfbc577
commit
b05c4b4b82
|
@ -15,7 +15,7 @@ export default function MyDutyPathContainer() {
|
|||
pageSize: 12,
|
||||
where: {
|
||||
type: PostType.PATH,
|
||||
authorId: user.id,
|
||||
authorId: user?.id,
|
||||
...termsCondition,
|
||||
...searchCondition,
|
||||
},
|
||||
|
|
|
@ -44,10 +44,12 @@ export default function MindEditor({ id }: { id?: string }) {
|
|||
// },
|
||||
// { enabled: Boolean(id) }
|
||||
// );
|
||||
|
||||
const canEdit: boolean = useMemo(() => {
|
||||
const isAuth = isAuthenticated && user?.id === post?.author?.id;
|
||||
return !!id || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST);
|
||||
return !id || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST);
|
||||
}, [user]);
|
||||
|
||||
const navigate = useNavigate();
|
||||
const { create, update } = usePost();
|
||||
const { data: taxonomies } = api.taxonomy.getAll.useQuery({
|
||||
|
@ -178,10 +180,12 @@ export default function MindEditor({ id }: { id?: string }) {
|
|||
useEffect(() => {
|
||||
containerRef.current.style.height = `${Math.floor(window.innerHeight - 271)}px`;
|
||||
}, []);
|
||||
|
||||
useEffect(()=>{
|
||||
console.log(canEdit,user?.id,post?.author?.id)
|
||||
})
|
||||
return (
|
||||
<div className={` flex-col flex `}>
|
||||
{canEdit && taxonomies && (
|
||||
{taxonomies && (
|
||||
<Form form={form} className=" bg-white p-4 border-b">
|
||||
<div className="flex items-center justify-between gap-4">
|
||||
<div className="flex items-center gap-4">
|
||||
|
|
Loading…
Reference in New Issue