4-Integration-Testing/src/issues-data-storage.js
/**
   * Delete issue with specified id and persist it.
   * @returns {boolean} True if deleting issue was found and successfully persisted, false otherwise.
   * @param {*} id - Id of issue.
   * @throws {Error} Id of issue must be specified
   */
Delete issue with specified id and persist it.
@returns {boolean} True if deleting issue was found and successfully persisted, false otherwise.
@param {*} id - Id of issue.
@throws {Error} Id of issue must be specified
Delete issue with specified id and persist it . @returns { boolean } True if deleting issue was found and successfully persisted false otherwise . @param { * } id - Id of issue . @throws { Error } Id of issue must be specified
dateteIssueById(id) {
    if (!id) {
      throw new Error('Id should be passed th delete issue');
    }
    const indexOfIssueToDelete = this._issues.findIndex(issue => {
      return issue.id === id;
    });
    if (indexOfIssueToDelete > -1) {
      this._issues.splice(indexOfIssueToDelete, 1);
      return this.dataService.dateteEntityById(id);
    }
    return false;
  }
dateteIssueById ( id ) { if ( ! id ) { throw new Error ( 'Id should be passed th delete issue' ) ; } const indexOfIssueToDelete = this . _issues . findIndex ( issue => { return issue . id === id ; } ) ; if ( indexOfIssueToDelete > - 1 ) { this . _issues . splice ( indexOfIssueToDelete , 1 ) ; return this . dataService . dateteEntityById ( id ) ; } return false ; }
Delete issue with specified id and persist it.
Delete issue with specified id and persist it .