Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat-mindmap]: adds mindmap feature #12

Open
wants to merge 5 commits into
base: feat-mindmap
Choose a base branch
from

Conversation

BULMA-OO
Copy link

No description provided.

@BULMA-OO BULMA-OO self-assigned this Oct 29, 2024
Copy link

@devesh-verma devesh-verma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left comments inline please address all the issues.

apps/server/src/mindmap/mindmap.service.ts Show resolved Hide resolved
apps/server/src/mindmap/mindmap.service.ts Show resolved Hide resolved
apps/server/src/mindmap/mindmap.service.ts Show resolved Hide resolved
apps/server/src/mindmap/mindmap.service.ts Show resolved Hide resolved
...createMindmapDto,
userId: id,
name,
path: 'temp'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BULMA-OO lets get rid of this temp form everywhere and make use to actual path where the files will be stored.

apps/server/src/mindmap/mindmap.service.ts Show resolved Hide resolved
return this.mindmapService.create(
createMindmapDto,
request.user._id,
request.user.firstName,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BULMA-OO why are we sending user's firstName in the name property of mindmap?

apps/server/src/mindmap/mindmap.service.ts Show resolved Hide resolved

async upload(mindmap: { name: string; content: string; path: string }) {
const mindmapPayload = {
name: mindmap?.name ?? new Types.ObjectId().toString(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name property refers to the doc._id of the mindmap doc. But instead you are sending user.name in this property from the create function of the controller.

Comment on lines +34 to 40
const doc: any = await this.repository.findById(id);
if (doc) {
// 2. fetch content from s3
const key = doc.path;
const key = doc.path + '/' + doc._id;
const file = await this.fileService.getFile(key);
return file;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const doc: any = await this.repository.findById(id);
if (doc) {
// 2. fetch content from s3
const key = doc.path;
const key = doc.path + '/' + doc._id;
const file = await this.fileService.getFile(key);
return file;
}
const doc: Notes = await this.repository.findById(id);
if (doc) {
// 2. fetch content from s3
const key = doc.path + '/' + doc["_id"];
const file = await this.fileService.getFile(key);
return file;
}

@BULMA-OO Why are you assigning any to doc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants