How to use the entities.DbNote function in entities

To help you get started, we’ve selected a few entities examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix / quix / quix-frontend / service / src / modules / search / search.spec.ts View on Github external
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);
  };
github wix / quix / quix-frontend / service / src / modules / web-api / web-api.spec.ts View on Github external
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;
}