Skip to content

Commit 3cf1073

Browse files
author
Gavin Williams
committed
Use enums for consistency
1 parent 241cfbe commit 3cf1073

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • packages/web/src/app/api/(server)/agents/[agentId]

packages/web/src/app/api/(server)/agents/[agentId]/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,18 @@ export const PATCH = apiHandler(async (request: NextRequest, { params }: RoutePa
126126
const effectiveScope = scope ?? existing.scope;
127127

128128
// When scope changes to REPO/CONNECTION, IDs must be supplied
129-
if (effectiveScope === 'REPO' && scope === 'REPO' && (!repoIds || repoIds.length === 0)) {
129+
if (effectiveScope === AgentScope.REPO && scope === AgentScope.REPO && (!repoIds || repoIds.length === 0)) {
130130
return {
131131
statusCode: StatusCodes.BAD_REQUEST,
132-
errorCode: 'INVALID_REQUEST_BODY',
132+
errorCode: ErrorCode.INVALID_REQUEST_BODY,
133133
message: "repoIds is required when scope is REPO",
134134
};
135135
}
136136

137-
if (effectiveScope === 'CONNECTION' && scope === 'CONNECTION' && (!connectionIds || connectionIds.length === 0)) {
137+
if (effectiveScope === AgentScope.CONNECTION && scope === AgentScope.CONNECTION && (!connectionIds || connectionIds.length === 0)) {
138138
return {
139139
statusCode: StatusCodes.BAD_REQUEST,
140-
errorCode: 'INVALID_REQUEST_BODY',
140+
errorCode: ErrorCode.INVALID_REQUEST_BODY,
141141
message: "connectionIds is required when scope is CONNECTION",
142142
};
143143
}

0 commit comments

Comments
 (0)