fix: handle null in service status select onValueChange
TypeScript error: Select onValueChange passes string | null, not string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
a81a01a06d
commit
5c3e3c4bc8
@@ -74,8 +74,8 @@ export default function ServiceDetailPage() {
|
|||||||
return () => { cancelled = true; };
|
return () => { cancelled = true; };
|
||||||
}, [params.id, retryCounter]);
|
}, [params.id, retryCounter]);
|
||||||
|
|
||||||
const changeStatus = async (newStatus: string) => {
|
const changeStatus = async (newStatus: string | null) => {
|
||||||
if (!service || newStatus === service.status) return;
|
if (!service || !newStatus || newStatus === service.status) return;
|
||||||
setUpdatingStatus(true);
|
setUpdatingStatus(true);
|
||||||
try {
|
try {
|
||||||
await api.patch(`/services/${params.id}/status`, { status: newStatus });
|
await api.patch(`/services/${params.id}/status`, { status: newStatus });
|
||||||
|
|||||||
Reference in New Issue
Block a user