Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createNote = async (
notebookId: string,
template: Partial = {},
) => {
const base = Object.assign(
{
id: uuid(),
name: 'New Note',
owner: defaultUser,
textContent: '',
type: 'presto',
},
template,
);
const note = new DbNote({
id: base.id,
owner: base.owner,
type: base.type,
textContent: base.textContent,
name: base.name,
dateCreated: 1,
dateUpdated: 1,
notebookId,
jsonContent: undefined,
});
note.rank = 0;
return noteRepo.save(note);
};
function createNote(defaultUser: string, noteName: string, notebookId: string) {
const note = new DbNote({
id: uuid(),
owner: defaultUser,
name: noteName,
textContent: '',
jsonContent: undefined,
type: 'presto',
notebookId,
dateCreated: 1,
dateUpdated: 1,
});
return note;
}