Merge branch 'dev-1' of https://gitlab.com/hanifsalafi/new-netidhub-public
This commit is contained in:
commit
f191f0edc1
|
|
@ -26,6 +26,7 @@ type CategoryDetail = {
|
|||
isActive: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdByFullname : string;
|
||||
};
|
||||
|
||||
type CurrentUser = {
|
||||
|
|
@ -39,11 +40,11 @@ export default function CategoriesDetailForm() {
|
|||
const router = useRouter();
|
||||
const [detail, setDetail] = useState<CategoryDetail | null>(null);
|
||||
const [currentUser, setCurrentUser] = useState<CurrentUser | null>(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
getUserInfo().then((res) => setCurrentUser(res.data.data));
|
||||
}, []);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
async function init() {
|
||||
if (id) {
|
||||
|
|
@ -125,14 +126,7 @@ export default function CategoriesDetailForm() {
|
|||
{/* Creator */}
|
||||
<div>
|
||||
<Label>Created By</Label>
|
||||
<Input
|
||||
readOnly
|
||||
value={
|
||||
currentUser && currentUser.id === detail.createdById
|
||||
? currentUser.fullname || currentUser.username
|
||||
: `User ID ${detail.createdById}`
|
||||
}
|
||||
/>
|
||||
<Input readOnly value={detail.createdByFullname || "-"} />
|
||||
|
||||
{/* <Input
|
||||
type="text"
|
||||
|
|
|
|||
Loading…
Reference in New Issue