Open samislam opened 3 months ago
I wanted to perform this and I thought it's gonna work:
const dbEntries = await paginate(query, this.clientsRepo, { sortableColumns: getColumns(this.clientsRepo, true).names, select: getColumns(this.clientsRepo, true).names, origin: '', // 👈 })
But it didn't, I wanted to change the links.cuurent origin, from:
links.cuurent
"links": { "current": "http://localhost:3001/clients?page=1&limit=20&sortBy=accountType:ASC&select=username,accountType" }
to
"links": { "current": "/clients?page=1&limit=20&sortBy=accountType:ASC&select=username,accountType" }
But it doesn't work, I also tried to put "/", but it resulted in double slashes as follows:
"/"
"links": { "current": "//clients?page=1&limit=20&sortBy=accountType:ASC&select=username,accountType" }
I think this is because the library somewhere in its code checks on the property if it exists by some approach like this:
if(!!origin) { /* do the `origin` logic */ }
I think it should handle this case by something like this:
if(origin == "" || !!origin) { /* do the `origin` logic */ }
I like origin '/' more as a notation for this than ''. We'd love to see a PR for this with a test that verifies this works as expected :)
'/'
''
I wanted to perform this and I thought it's gonna work:
But it didn't, I wanted to change the
links.cuurent
origin, from:to
But it doesn't work, I also tried to put
"/"
, but it resulted in double slashes as follows:I think this is because the library somewhere in its code checks on the property if it exists by some approach like this:
I think it should handle this case by something like this: