Skip to content

Commit 0888c2a

Browse files
committed
prettier
1 parent 362ef6c commit 0888c2a

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/functions/teams/create/handler.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const teamsCreate: ValidatedEventAPIGatewayProxyEvent<typeof schema> = async (ev
3333
}),
3434
};
3535
}
36-
36+
3737
if (teamName.length > 50) {
3838
return {
3939
statusCode: 400,
@@ -43,7 +43,7 @@ const teamsCreate: ValidatedEventAPIGatewayProxyEvent<typeof schema> = async (ev
4343
}),
4444
};
4545
}
46-
46+
4747
// Check for invalid characters (only allow alphanumeric, spaces, hyphens, underscores)
4848
const validNamePattern = /^[a-zA-Z0-9\s\-_]+$/;
4949
if (!validNamePattern.test(teamName)) {
@@ -157,7 +157,7 @@ const teamsCreate: ValidatedEventAPIGatewayProxyEvent<typeof schema> = async (ev
157157

158158
// Use MongoDB transaction for atomic team creation
159159
const session = db.getClient().startSession();
160-
160+
161161
try {
162162
await session.withTransaction(async () => {
163163
// Create team within transaction
@@ -182,9 +182,8 @@ const teamsCreate: ValidatedEventAPIGatewayProxyEvent<typeof schema> = async (ev
182182
// Send invitations to all members via teamInviteLogic utility
183183
const inviteResult = await teamInviteLogic(event.body.auth_email, event.body.auth_token, teamId, memberEmails);
184184

185-
if (inviteResult.statusCode !== 200)
185+
if (inviteResult.statusCode !== 200)
186186
throw new Error(`Team invite failed with status ${inviteResult.statusCode}: ${inviteResult.body}`);
187-
188187
});
189188
} catch (transactionError) {
190189
console.error('Transaction failed:', transactionError);

tests/teams-create.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('Teams Create Handler', () => {
5959
mockTeamsCollection.insertOne.mockResolvedValue({ acknowledged: true });
6060
mockUsersCollection.updateOne.mockResolvedValue({ acknowledged: true });
6161
mockTeamsCollection.deleteOne.mockResolvedValue({ acknowledged: true });
62-
62+
6363
// Mock transaction to execute the callback immediately
6464
mockSession.withTransaction.mockImplementation(async (callback) => {
6565
return await callback();
@@ -259,7 +259,7 @@ describe('Teams Create Handler', () => {
259259

260260
// Verify transaction was attempted
261261
expect(mockSession.withTransaction).toHaveBeenCalled();
262-
262+
263263
// Verify session cleanup
264264
expect(mockSession.endSession).toHaveBeenCalled();
265265

0 commit comments

Comments
 (0)