Commit 5983d793 authored by tushar5526's avatar tushar5526
Browse files

feat: added student and tutor getdata paths

No related merge requests found
Showing with 26 additions and 1 deletion
+26 -1
...@@ -28,4 +28,14 @@ export class AppController { ...@@ -28,4 +28,14 @@ export class AppController {
getUserCredentials(@Param() params) { getUserCredentials(@Param() params) {
return this.appService.getUserCredentials(params.id); return this.appService.getUserCredentials(params.id);
} }
@Get('student/:id')
getStudent(@Param() params) {
return this.appService.getStudentById(params.id);
}
@Get('tutor/:id')
getTutor(@Param() params) {
return this.appService.getTutorById(params.id);
}
} }
import { Injectable, Inject } from '@nestjs/common'; import { Injectable, Inject } from '@nestjs/common';
import { MSSQL_CONNECTION } from './constants'; import { MSSQL_CONNECTION } from './constants';
import * as bcrypt from 'bcrypt';
import * as CryptoJS from 'crypto'; import * as CryptoJS from 'crypto';
@Injectable() @Injectable()
...@@ -108,4 +107,20 @@ export class AppService { ...@@ -108,4 +107,20 @@ export class AppService {
}); });
return cred_res[0]; return cred_res[0];
} }
async getTutorById(id: string) {
const db = await this.conn.connect();
const res = await db.query(
`Select * from test.dbo.Master_Tutor_Basic_Info where TutorKey='${id}'`,
);
return res.recordset[0];
}
async getStudentById(id: string) {
const db = await this.conn.connect();
const res = await db.query(
`Select * from test.dbo.Master_StudentProfile where StudentProfileKey='${id}'`,
);
return res.recordset[0];
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment