Skip to content

Commit

Permalink
update on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hugosandsjo committed Sep 19, 2024
1 parent 7121acb commit 9b61681
Show file tree
Hide file tree
Showing 5 changed files with 325 additions and 309 deletions.
1 change: 1 addition & 0 deletions backend/docker/docker-compose-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
environment:
DATABASE_URL: "mongodb://mongo:27017/codepair"
# Environment variables need to be passed to the container
# You can find the description of each environment variable in the backend/.env.development file
GITHUB_CLIENT_ID: "your_github_client_id_here"
GITHUB_CLIENT_SECRET: "your_github_client_secret_here"
GITHUB_CALLBACK_URL: "http://localhost:3000/auth/login/github"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
ApiNotFoundResponse,
ApiOkResponse,
ApiOperation,
ApiParam,
ApiQuery,
ApiTags,
} from "@nestjs/swagger";
Expand All @@ -43,6 +44,14 @@ export class WorkspaceDocumentsController {
summary: "Update the title of a document in the workspace",
description: "If the user has the access permissions, update the document's title.",
})
@ApiParam({
name: "workspace_id",
description: "ID of workspace",
})
@ApiParam({
name: "document_id",
description: "ID of document to change title",
})
@ApiOkResponse({
description: "Document title updated successfully",
})
Expand Down
11 changes: 0 additions & 11 deletions backend/src/workspace-documents/workspace-documents.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ export class WorkspaceDocumentsService {
);
}

const document = await this.prismaService.document.findFirst({
where: {
id: documentId,
workspaceId: workspaceId,
},
});

if (!document) {
throw new NotFoundException("Document not found");
}

await this.prismaService.document.update({
where: { id: documentId },
data: { title: title },
Expand Down
Loading

0 comments on commit 9b61681

Please sign in to comment.