Skip to content

Commit

Permalink
Fix Errors on Register & getProduct (string -> number)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChachoPacho committed Oct 15, 2021
1 parent 6c1d380 commit d7635ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/server/classes/DataBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ export default class DataBase extends Filter {
}

private returnConfig(): any {
return this.returnTable(this.getTablePath("config"));
return this.returnTable("config");
}
}
2 changes: 1 addition & 1 deletion app/server/classes/ProductsAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ export default class ProductsAPI extends DataBase {

public getProduct(): Product {
const { id } = this.params;
return this.products.find((product: any) => product.id === id);
return this.products.find((product: any) => product.id === +id);
}
}
2 changes: 2 additions & 0 deletions app/server/classes/UsersAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export default class UsersAPI extends DataBase {
id: config.maxID,
});

this.setTable("users", this.users);

return config.maxID;
}

Expand Down

0 comments on commit d7635ef

Please sign in to comment.