How to use the entities/utils.extractOwnerDetails 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 / web-api / favorites / favorites.service.ts View on Github external
function favoriteToIFile(fav: GetFavoritesQueryReturnValue): IFile {
  const {notebook, notebookOwnerDetails} = fav;
  notebook.ownerDetails = notebookOwnerDetails;
  const {id, owner, dateCreated, dateUpdated, name} = notebook;
  const ownerDetails = extractOwnerDetails(notebook);

  return {
    isLiked: true,
    ownerDetails,
    owner,
    id,
    dateCreated,
    dateUpdated,
    path: [],
    name,
    type: FileType.notebook,
  };
}
github wix / quix / quix-frontend / service / src / modules / web-api / folders / utils.ts View on Github external
} else {
    const parentFile = convertToIFile(node.parentId, noteMap, resultMap);
    path = parentFile.path.concat([{id: parentFile.id, name: parentFile.name}]);
  }

  const name =
    node.type === FileType.folder ? node.folder!.name : node.notebook!.name;

  const result: IFile = {
    id: node.type === FileType.folder ? id : node.notebookId!,
    dateCreated,
    dateUpdated,
    type,
    name,
    owner,
    ownerDetails: extractOwnerDetails(node),
    isLiked: false,
    path,
  };

  resultMap.set(id, result);
  return result;
}
github wix / quix / quix-frontend / service / src / modules / web-api / folders / utils.ts View on Github external
export function convertSingleNodeToIFile(
  node: DbFileTreeNode,
  path: IFilePathItem[],
) {
  const {id, dateCreated, dateUpdated, owner, type} = node;
  const name = computeName(node);

  const nodeAsFile: IFile = {
    id,
    name,
    path,
    dateCreated,
    dateUpdated,
    owner,
    ownerDetails: extractOwnerDetails(node),
    type,
    isLiked: false,
  };
  return nodeAsFile;
}