feat: add featured doctors and health packages APIs
This commit is contained in:
@@ -120,22 +120,40 @@ export default function HealthPackageModal({
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between border rounded-xl p-4 bg-muted/30">
|
||||
<div>
|
||||
<p className="font-semibold">Active Visibility</p>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="flex items-center justify-between border rounded-xl p-4 bg-muted/30">
|
||||
<div>
|
||||
<p className="font-semibold">Active</p>
|
||||
<p className="text-sm text-muted-foreground">Show publicly</p>
|
||||
</div>
|
||||
|
||||
<p className="text-sm text-muted-foreground">Show this package publicly</p>
|
||||
<Switch
|
||||
checked={pkgForm.isActive}
|
||||
onCheckedChange={(val) =>
|
||||
setPkgForm({
|
||||
...pkgForm,
|
||||
isActive: val,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Switch
|
||||
checked={pkgForm.isActive}
|
||||
onCheckedChange={(val) =>
|
||||
setPkgForm({
|
||||
...pkgForm,
|
||||
isActive: val,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<div className="flex items-center justify-between border rounded-xl p-4 bg-muted/30">
|
||||
<div>
|
||||
<p className="font-semibold">Featured</p>
|
||||
<p className="text-sm text-muted-foreground">Show on homepage</p>
|
||||
</div>
|
||||
|
||||
<Switch
|
||||
checked={pkgForm.isFeatured || false}
|
||||
onCheckedChange={(val) =>
|
||||
setPkgForm({
|
||||
...pkgForm,
|
||||
isFeatured: val,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
|
||||
@@ -62,6 +62,7 @@ export default function HealthPackagePage() {
|
||||
discountedPrice: undefined,
|
||||
categoryId: 0,
|
||||
isActive: true,
|
||||
isFeatured: false,
|
||||
sortOrder: 1000,
|
||||
seo: {
|
||||
seoTitle: '',
|
||||
@@ -167,6 +168,7 @@ export default function HealthPackagePage() {
|
||||
discountedPrice: undefined,
|
||||
categoryId: categories[0]?.id || 0,
|
||||
isActive: true,
|
||||
isFeatured: false,
|
||||
sortOrder: 1000,
|
||||
seo: {
|
||||
seoTitle: '',
|
||||
@@ -366,6 +368,7 @@ export default function HealthPackagePage() {
|
||||
<TableHead className="w-[150px] bg-background text-sm font-bold">Category</TableHead>
|
||||
<TableHead className="w-[150px] bg-background text-sm font-bold">Pricing</TableHead>
|
||||
<TableHead className="w-[120px] bg-background text-sm font-bold">Status</TableHead>
|
||||
<TableHead className="w-[100px] bg-background text-sm font-bold">Featured</TableHead>
|
||||
<TableHead className="w-[120px] bg-background text-right text-sm font-bold">Actions</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@@ -418,6 +421,17 @@ export default function HealthPackagePage() {
|
||||
</Badge>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Switch
|
||||
checked={pkg.isFeatured}
|
||||
onCheckedChange={async () => {
|
||||
await updateHealthPackageApi(pkg.id!, {
|
||||
isFeatured: !pkg.isFeatured,
|
||||
});
|
||||
fetchData();
|
||||
}}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<div className="flex justify-end gap-2">
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user