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; };
|
||||
}, [params.id, retryCounter]);
|
||||
|
||||
const changeStatus = async (newStatus: string) => {
|
||||
if (!service || newStatus === service.status) return;
|
||||
const changeStatus = async (newStatus: string | null) => {
|
||||
if (!service || !newStatus || newStatus === service.status) return;
|
||||
setUpdatingStatus(true);
|
||||
try {
|
||||
await api.patch(`/services/${params.id}/status`, { status: newStatus });
|
||||
|
||||
Reference in New Issue
Block a user