fix: remove duplicate getService, fix project uuid check for services
Made-with: Cursor
This commit is contained in:
@@ -49,7 +49,6 @@ import {
|
||||
listAllServices,
|
||||
listServiceEnvs,
|
||||
upsertServiceEnv,
|
||||
type ServiceEnvVar,
|
||||
updateApplication,
|
||||
deleteApplication,
|
||||
setApplicationDomains,
|
||||
@@ -446,8 +445,10 @@ async function toolAppsDeploy(principal: Principal, params: Record<string, any>)
|
||||
try {
|
||||
const svc = await getService(appUuid);
|
||||
// Verify it belongs to this workspace's project
|
||||
const proj = (svc.project as Record<string, unknown> | undefined);
|
||||
if (proj?.uuid !== projectUuid) {
|
||||
const svcProjectUuid = svc.project_uuid
|
||||
?? svc.environment?.project_uuid
|
||||
?? svc.environment?.project?.uuid;
|
||||
if (svcProjectUuid !== projectUuid) {
|
||||
return NextResponse.json({ error: 'Service not found in this workspace' }, { status: 404 });
|
||||
}
|
||||
await startService(appUuid);
|
||||
|
||||
Reference in New Issue
Block a user