Skip to content

Commit

Permalink
fix breadcrumbs not an array
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieVangeysel committed Dec 13, 2024
1 parent 55e7d8c commit c60b188
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
31 changes: 1 addition & 30 deletions src/repositories/browse.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,11 @@ export default class Browse {
result: {
directories: result.recordsets[1][0] || [],
documents: result.recordsets[2][0] || [],
breadcrumbs: result.recordsets[3][0] || []
breadcrumbs: result.recordsets[3] || []
}
}
} else {
throw new Error(error)
}
}

/**
* Get detail for ui page
* @deprecated No longer in use, use documentscontroller instead
* @param {number} id
* @param {number} user_id
* @returns {Promise<any>}
*/
async getBreadcrumbs(id: number, user_id?: string) {
const r = new sql.Request(this._pool)
r.input('id', sql.Int, id)
r.input('user_id', sql.Int, user_id)
this._logger.debug({ sqlParam: { id, user_id }, sqlSchema: this.schema, sqlProc: 'GetUiBreadcrumbs' }, 'running procedure')

const result = await r.execute('GetUiBreadcrumbs')
this._logger.debug({ result }, 'procedure result')

const { error, verified } = result.recordset[0]

if (!error) {
return {
error,
verified,
breadcrumbs: result.recordsets[1] || []
}
} else {
throw new Error(error)
}
}
}
4 changes: 2 additions & 2 deletions src/repositories/document.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class Document {
error,
verified,
result: result.recordsets[1][0][0] || [],
breadcrumbs: result.recordsets[2][0] || []
breadcrumbs: result.recordsets[2] || []
}
} else {
throw new Error(error)
Expand Down Expand Up @@ -314,7 +314,7 @@ export interface IDocument {
attributes?: number[]
}

export interface IPostedDocument{
export interface IPostedDocument {
uuid: string
directory_id: number
name: string
Expand Down

0 comments on commit c60b188

Please sign in to comment.