update ,
This commit is contained in:
@@ -12,7 +12,7 @@ import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { LpCategory } from '@/components/dashboard/lp_categories/type';
|
||||
|
||||
function getImageUrlFrRecord(record) {
|
||||
function getImageUrlFrRecord(record: LpCategory): string {
|
||||
return `http://127.0.0.1:8090/api/files/${record.collectionId}/${record.id}/${record.cat_image}`;
|
||||
}
|
||||
|
||||
|
@@ -45,14 +45,12 @@ export default function Page(): React.JSX.Element {
|
||||
router.push(paths.dashboard.lp_categories.edit(showLessonCategory.id));
|
||||
}
|
||||
|
||||
const [lpModel, setLpModel] = React.useState<RecordModel>(null);
|
||||
React.useEffect(() => {
|
||||
if (catId) {
|
||||
pb.collection(COL_LISTENINGS_PRACTICE_CATEGORIES)
|
||||
.getOne(catId)
|
||||
.then((model: RecordModel) => {
|
||||
setShowLessonCategory({ ...defaultLpCategory, ...model });
|
||||
setLpModel(model);
|
||||
})
|
||||
.catch((err) => {
|
||||
logger.error(err);
|
||||
@@ -104,7 +102,7 @@ export default function Page(): React.JSX.Element {
|
||||
spacing={3}
|
||||
sx={{ alignItems: 'flex-start' }}
|
||||
>
|
||||
<TitleCard lpModel={lpModel} />
|
||||
<TitleCard lpModel={showLessonCategory} />
|
||||
</Stack>
|
||||
</Stack>
|
||||
<Grid
|
||||
@@ -117,7 +115,7 @@ export default function Page(): React.JSX.Element {
|
||||
>
|
||||
<Stack spacing={4}>
|
||||
<BasicDetailCard
|
||||
lpModel={lpModel}
|
||||
lpModel={showLessonCategory}
|
||||
handleEditClick={handleEditClick}
|
||||
/>
|
||||
<SampleSecurityCard />
|
||||
|
@@ -99,8 +99,6 @@ export default function Page({ searchParams }: PageProps): React.JSX.Element {
|
||||
width: 'var(--Content-width)',
|
||||
}}
|
||||
>
|
||||
{JSON.stringify({ currentPage, rowsPerPage })}
|
||||
|
||||
<Stack spacing={4}>
|
||||
<Stack
|
||||
direction={{ xs: 'column', sm: 'row' }}
|
||||
|
Reference in New Issue
Block a user