fix: prevent potential crashes
This commit is contained in:
parent
a6001ee47a
commit
91db3f91b6
1 changed files with 2 additions and 1 deletions
|
|
@ -71,7 +71,8 @@ export class DataTablesSsp {
|
|||
this.length = Math.min(100, Math.max(0, parseInt(query.length as string, 10)));
|
||||
this.draw = parseInt(query.draw as string, 10);
|
||||
this._order = (query.order as { column: string; dir: string }[]).map((order) => {
|
||||
return { column: parseInt(order.column, 10), dir: order.dir };
|
||||
const dir = order.dir.toUpperCase() === "DESC" ? "DESC" : "ASC";
|
||||
return { column: parseInt(order.column, 10), dir };
|
||||
});
|
||||
this.columns = (
|
||||
query.columns as { data: string; name: string; searchable: string; orderable: string; search: { value: string; regex: string } }[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue