Funcionan todos los select, pendiente el general
This commit is contained in:
@@ -219,15 +219,16 @@ export class SimController {
|
||||
*/
|
||||
public select() {
|
||||
return async (req: Request, res: Response) => {
|
||||
console.log("SELECT: ", req.query)
|
||||
const iccid = req.query.iccid as string
|
||||
try {
|
||||
iccidValidator.validate({ iccid: iccid })
|
||||
} catch (e) {
|
||||
const validationRes = iccidValidator.validate({ iccid: iccid })
|
||||
if (validationRes.error != undefined) {
|
||||
res.status(422).json({
|
||||
errors: {
|
||||
msg: e
|
||||
...validationRes.error
|
||||
}
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
const company = companyFromIccid(iccid)
|
||||
@@ -239,9 +240,9 @@ export class SimController {
|
||||
}
|
||||
|
||||
try {
|
||||
const respSelect = await axios.get(url + endpoint)
|
||||
const respSelect = await axios.get(url + endpoint, { params: req.query })
|
||||
res.json(respSelect.data)
|
||||
// TODO: 200
|
||||
|
||||
} catch (err) {
|
||||
if (isAxiosError(err)) {
|
||||
const axiosErr = err as AxiosError
|
||||
|
||||
Reference in New Issue
Block a user