API mod as per 22-07-2025 requested

This commit is contained in:
Kallesh B S 2025-07-22 20:23:10 +05:30
parent 6a68ca024a
commit ef929e8fb5
4 changed files with 26 additions and 7 deletions

View File

@ -966,7 +966,9 @@ export class CarnetApplicationService {
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) {
handleError(error, CarnetApplicationService.name)
} finally {
@ -1001,7 +1003,15 @@ export class CarnetApplicationService {
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) {
handleError(error, CarnetApplicationService.name)
} finally {
@ -1035,7 +1045,9 @@ export class CarnetApplicationService {
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) {
handleError(error, CarnetApplicationService.name)
} finally {
@ -1069,7 +1081,9 @@ export class CarnetApplicationService {
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) {
handleError(error, CarnetApplicationService.name)
} finally {

View File

@ -672,8 +672,10 @@ export class ManageClientsService {
this.logger.error('One or more expected cursors are missing from stored procedure output.');
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) {
handleError(error, ManageClientsService.name)

View File

@ -11,6 +11,7 @@ import { JwtAuthGuard } from 'src/guards/jwt-auth.guard';
import { RolesGuard } from 'src/guards/roles.guard';
@ApiTags('Param Table - Oracle')
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles('sa', 'ua')
@Controller('oracle')
export class ParamTableController {
@ -18,7 +19,6 @@ export class ParamTableController {
@Get('/GetParamValues')
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles('ca', 'sa', 'ua')
@ApiQuery({
name: 'P_SPID',
@ -37,6 +37,7 @@ export class ParamTableController {
}
@Get('GetCountriesAndMessages')
@Roles('ca', 'sa', 'ua')
GET_COUNTRIES_AND_MESSAGES() {
return this.paramTableService.GET_COUNTRIES_AND_MESSAGES();
}

View File

@ -241,7 +241,9 @@ export class SpService {
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) {
handleError(error, SpService.name)