modified api
This commit is contained in:
parent
98f70b9784
commit
d66dccd637
@ -1,4 +1,4 @@
|
|||||||
GET http://localhost:3000/oracle/GetPreparerByClientid?p_spid=as&p_clientid=8
|
GET http://localhost:3000/mssql/GetParamValues?P_PARAMTYPE=000&P_SPID=asdf
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
|
|||||||
@ -17,10 +17,13 @@ export class ParamTableService {
|
|||||||
|
|
||||||
async GETPARAMVALUES(body: getParamValuesDTO) {
|
async GETPARAMVALUES(body: getParamValuesDTO) {
|
||||||
const finalBody = {
|
const finalBody = {
|
||||||
P_SPID: body.P_SPID ? body.P_SPID : null,
|
P_SPID: body.P_SPID === 0 ? body.P_SPID : body.P_SPID ? body.P_SPID : null,
|
||||||
P_PARAMTYPE: body.P_PARAMTYPE ? body.P_PARAMTYPE : null,
|
P_PARAMTYPE: body.P_PARAMTYPE ? body.P_PARAMTYPE : null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(finalBody);
|
||||||
|
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: Connection;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
@ -60,6 +63,7 @@ export class ParamTableService {
|
|||||||
async CREATEPARAMRECORD(body: CreateParamRecordDTO) {
|
async CREATEPARAMRECORD(body: CreateParamRecordDTO) {
|
||||||
let connection: Connection;
|
let connection: Connection;
|
||||||
try {
|
try {
|
||||||
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
request.input('P_SPID', mssql.Int, body.P_SPID);
|
request.input('P_SPID', mssql.Int, body.P_SPID);
|
||||||
request.input('P_PARAMTYPE', mssql.VarChar(255), body.P_PARAMTYPE);
|
request.input('P_PARAMTYPE', mssql.VarChar(255), body.P_PARAMTYPE);
|
||||||
@ -86,6 +90,7 @@ export class ParamTableService {
|
|||||||
async UPDATEPARAMRECORD(body: UpdateParamRecordDTO) {
|
async UPDATEPARAMRECORD(body: UpdateParamRecordDTO) {
|
||||||
let connection: Connection;
|
let connection: Connection;
|
||||||
try {
|
try {
|
||||||
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
request.input('P_SPID', mssql.Int, body.P_SPID);
|
request.input('P_SPID', mssql.Int, body.P_SPID);
|
||||||
request.input('P_PARAMID', mssql.Int, body.P_PARAMID);
|
request.input('P_PARAMID', mssql.Int, body.P_PARAMID);
|
||||||
|
|||||||
@ -122,9 +122,9 @@ export class UpdateParamRecordDTO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class getParamValuesDTO {
|
export class getParamValuesDTO {
|
||||||
|
@Min(0, { message: 'Property P_SPID must be at least 0' })
|
||||||
@IsInt({ message: 'Property P_SPID must be a whole number' })
|
@IsInt({ message: 'Property P_SPID must be a whole number' })
|
||||||
@IsNumber({}, { message: 'Property P_SPID must be a number' })
|
@IsNumber({}, { message: 'Property P_SPID must be a number' })
|
||||||
@Min(0, { message: 'Property P_SPID must be at least 0' })
|
|
||||||
@Transform(({ value }) => Number(value))
|
@Transform(({ value }) => Number(value))
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
P_SPID?: number;
|
P_SPID?: number;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user