Skip to content

Commit 2310d09

Browse files
authored
Prepare fastify update (#2140)
Part of OPS-3917
1 parent 8086591 commit 2310d09

5 files changed

Lines changed: 23 additions & 5 deletions

File tree

packages/server/api/src/app/app-connection/app-connection.controller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ const GetAppConnectionRequest = {
258258
{ additionalProperties: true },
259259
),
260260
]),
261+
[StatusCodes.BAD_REQUEST]: Type.Null(),
261262
},
262263
},
263264
};

packages/server/api/src/app/dashboards/dashboards-module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const StatsRequest = {
8888
}),
8989
response: {
9090
[StatusCodes.OK]: WorkflowStats,
91+
[StatusCodes.INTERNAL_SERVER_ERROR]: Type.Null(),
9192
},
9293
},
9394
};

packages/server/api/src/app/flows/flow/flow-version.controller.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ export const flowVersionController: FastifyPluginAsyncTypebox = async (
4242
success: Type.Boolean(),
4343
message: Type.String(),
4444
}),
45+
[StatusCodes.BAD_REQUEST]: Type.Object({
46+
success: Type.Boolean(),
47+
message: Type.String(),
48+
}),
49+
[StatusCodes.CONFLICT]: Type.Object({
50+
success: Type.Boolean(),
51+
message: Type.String(),
52+
}),
53+
[StatusCodes.INTERNAL_SERVER_ERROR]: Type.Object({
54+
success: Type.Boolean(),
55+
message: Type.String(),
56+
}),
4557
},
4658
},
4759
},
@@ -58,6 +70,7 @@ export const flowVersionController: FastifyPluginAsyncTypebox = async (
5870
message:
5971
'It is not possible to update the flowId of a flow version',
6072
});
73+
return;
6174
}
6275

6376
await assertFlowVersionBelongsToProject(
@@ -70,6 +83,7 @@ export const flowVersionController: FastifyPluginAsyncTypebox = async (
7083
success: false,
7184
message: 'The flow version is locked',
7285
});
86+
return;
7387
}
7488

7589
if (
@@ -80,6 +94,7 @@ export const flowVersionController: FastifyPluginAsyncTypebox = async (
8094
success: false,
8195
message: 'The flow version has been updated by another user',
8296
});
97+
return;
8398
}
8499

85100
const userId = request.principal.id;

packages/server/api/src/app/project/project-controller.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
import {
66
ApplicationError,
77
PrincipalType,
8-
Project,
8+
ProjectWithoutSensitiveData,
99
SeekPage,
1010
} from '@openops/shared';
1111
import { getProjectScopedRoutePolicy } from '../core/security/route-policies/route-security-policy-factory';
@@ -56,8 +56,6 @@ export const userProjectController: FastifyPluginCallbackTypebox = (
5656
done();
5757
};
5858

59-
const ProjectWithoutToken = Type.Omit(Project, ['tablesDatabaseToken']);
60-
6159
const GetUserProjectRequestOptions = {
6260
config: {
6361
security: getProjectScopedRoutePolicy({
@@ -66,7 +64,9 @@ const GetUserProjectRequestOptions = {
6664
},
6765
schema: {
6866
response: {
69-
200: ProjectWithoutToken,
67+
200: ProjectWithoutSensitiveData,
68+
401: Type.Null(),
69+
404: Type.Null(),
7070
},
7171
},
7272
};
@@ -79,7 +79,7 @@ const ListUserProjectsRequestOptions = {
7979
},
8080
schema: {
8181
response: {
82-
200: SeekPage(ProjectWithoutToken),
82+
200: SeekPage(ProjectWithoutSensitiveData),
8383
},
8484
},
8585
};

packages/server/api/src/app/user-settings/user-settings.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const GetUserSettingsRequestOptions = {
7070
security: [SERVICE_KEY_SECURITY_OPENAPI],
7171
response: {
7272
[StatusCodes.OK]: UserSettingsDefinition,
73+
[StatusCodes.NOT_FOUND]: Type.Null(),
7374
},
7475
},
7576
};

0 commit comments

Comments
 (0)