API mod as per 22-07-2025 requested
This commit is contained in:
parent
6a68ca024a
commit
91208d950d
@ -966,7 +966,9 @@ export class CarnetApplicationService {
|
|||||||
throw new InternalServerException("Incomplete data received from the database.");
|
throw new InternalServerException("Incomplete data received from the database.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return await fetchCursor(outBinds.P_CURSOR, CarnetApplicationService.name);
|
const fres: any = await fetchCursor(outBinds.P_CURSOR, CarnetApplicationService.name);
|
||||||
|
|
||||||
|
return fres.length > 0 ? fres[0] : [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, CarnetApplicationService.name)
|
handleError(error, CarnetApplicationService.name)
|
||||||
} finally {
|
} finally {
|
||||||
@ -1001,7 +1003,15 @@ export class CarnetApplicationService {
|
|||||||
throw new InternalServerException("Incomplete data received from the database.");
|
throw new InternalServerException("Incomplete data received from the database.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return await fetchCursor(outBinds.P_CURSOR, CarnetApplicationService.name);
|
|
||||||
|
const fres: any = await fetchCursor(outBinds.P_CURSOR, CarnetApplicationService.name);
|
||||||
|
|
||||||
|
// if (fres.length > 0 && fres[0].ERRORMESG) {
|
||||||
|
// this.logger.warn(fres[0].ERRORMESG);
|
||||||
|
// throw new BadRequestException(fres[0].ERRORMESG)
|
||||||
|
// }
|
||||||
|
|
||||||
|
return fres.length > 0 ? fres[0] : [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, CarnetApplicationService.name)
|
handleError(error, CarnetApplicationService.name)
|
||||||
} finally {
|
} finally {
|
||||||
@ -1035,7 +1045,16 @@ export class CarnetApplicationService {
|
|||||||
throw new InternalServerException("Incomplete data received from the database.");
|
throw new InternalServerException("Incomplete data received from the database.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return await fetchCursor(outBinds.P_CURSOR, CarnetApplicationService.name);
|
const fres: any = await fetchCursor(outBinds.P_CURSOR, CarnetApplicationService.name);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return fres.length > 0 ?
|
||||||
|
{
|
||||||
|
NOOFUSSETS: fres[0].NOOFUSSETS,
|
||||||
|
P_COUNTRYTABLE: fres.map(({ NOOFUSSETS, ...rest }) => rest)
|
||||||
|
}
|
||||||
|
: {};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, CarnetApplicationService.name)
|
handleError(error, CarnetApplicationService.name)
|
||||||
} finally {
|
} finally {
|
||||||
@ -1069,7 +1088,9 @@ export class CarnetApplicationService {
|
|||||||
throw new InternalServerException("Incomplete data received from the database.");
|
throw new InternalServerException("Incomplete data received from the database.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return await fetchCursor(outBinds.P_CURSOR, CarnetApplicationService.name);
|
const fres: any = await fetchCursor(outBinds.P_CURSOR, CarnetApplicationService.name);
|
||||||
|
|
||||||
|
return fres.length > 0 ? fres[0] : [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, CarnetApplicationService.name)
|
handleError(error, CarnetApplicationService.name)
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@ -672,8 +672,10 @@ export class ManageClientsService {
|
|||||||
this.logger.error('One or more expected cursors are missing from stored procedure output.');
|
this.logger.error('One or more expected cursors are missing from stored procedure output.');
|
||||||
throw new InternalServerException("Incomplete data received from the database.");
|
throw new InternalServerException("Incomplete data received from the database.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fres: any = await fetchCursor(outBinds.P_CURSOR, ManageClientsService.name);
|
||||||
|
|
||||||
return await fetchCursor(outBinds.P_CURSOR, ManageClientsService.name);
|
return fres.length > 0 ? fres[0] : [];
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, ManageClientsService.name)
|
handleError(error, ManageClientsService.name)
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import { JwtAuthGuard } from 'src/guards/jwt-auth.guard';
|
|||||||
import { RolesGuard } from 'src/guards/roles.guard';
|
import { RolesGuard } from 'src/guards/roles.guard';
|
||||||
|
|
||||||
@ApiTags('Param Table - Oracle')
|
@ApiTags('Param Table - Oracle')
|
||||||
|
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||||
@Roles('sa', 'ua')
|
@Roles('sa', 'ua')
|
||||||
@Controller('oracle')
|
@Controller('oracle')
|
||||||
export class ParamTableController {
|
export class ParamTableController {
|
||||||
@ -18,7 +19,6 @@ export class ParamTableController {
|
|||||||
|
|
||||||
|
|
||||||
@Get('/GetParamValues')
|
@Get('/GetParamValues')
|
||||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
|
||||||
@Roles('ca', 'sa', 'ua')
|
@Roles('ca', 'sa', 'ua')
|
||||||
@ApiQuery({
|
@ApiQuery({
|
||||||
name: 'P_SPID',
|
name: 'P_SPID',
|
||||||
@ -37,6 +37,7 @@ export class ParamTableController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get('GetCountriesAndMessages')
|
@Get('GetCountriesAndMessages')
|
||||||
|
@Roles('ca', 'sa', 'ua')
|
||||||
GET_COUNTRIES_AND_MESSAGES() {
|
GET_COUNTRIES_AND_MESSAGES() {
|
||||||
return this.paramTableService.GET_COUNTRIES_AND_MESSAGES();
|
return this.paramTableService.GET_COUNTRIES_AND_MESSAGES();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,7 +241,9 @@ export class SpService {
|
|||||||
throw new InternalServerException("Incomplete data received from the database.");
|
throw new InternalServerException("Incomplete data received from the database.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return await fetchCursor(outBinds.P_CURSOR, SpService.name);
|
const fres: any = await fetchCursor(outBinds.P_CURSOR, SpService.name);
|
||||||
|
|
||||||
|
return fres.length > 0 ? fres[0] : [];
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, SpService.name)
|
handleError(error, SpService.name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user