Skip to content

Commit

Permalink
Merge pull request #65 from YoginiTayade/student-schoolList-function
Browse files Browse the repository at this point in the history
Resolbed the query issue in getSchoolList api
  • Loading branch information
ankush-maherwal authored Sep 12, 2024
2 parents 74816be + 6f4f6c2 commit d8adb05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions src/adapters/hasura/altStudent.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ export class ALTStudentService {
: "";

const data = {
query: `query MyQuery {
query: `query GetStateList {
Students (distinct_on: state ${filterQuery}) {
state
}
Expand Down Expand Up @@ -834,7 +834,7 @@ export class ALTStudentService {

filterQuery += `}`;
const data = {
query: `query MyQuery {
query: `query GetDistrictList {
Students (distinct_on: district ${filterQuery}) {
district
}
Expand Down Expand Up @@ -892,7 +892,7 @@ export class ALTStudentService {
filterQuery += `}`;

const data = {
query: `query MyQuery {
query: `query GetBlockList {
Students (distinct_on: block ${filterQuery}) {
block
}
Expand All @@ -915,7 +915,6 @@ export class ALTStudentService {
};

const response = await this.axios(config);
console.log(response.data);

if (response?.data?.errors) {
return res.status(500).send({
Expand Down Expand Up @@ -951,11 +950,9 @@ export class ALTStudentService {
filterQuery += `}`;

const data = {
query: `query MyQuery {
Students(distinct_on: schoolUdise, ${filterQuery}) {
state
block
district
query: `query GetSchoolList {
School (distinct_on: udiseCode, ${filterQuery}) {
name
}
}
Expand Down Expand Up @@ -985,7 +982,7 @@ export class ALTStudentService {
});
}

const responseData = response.data.data.Students;
const responseData = response.data.data.School;

return res.status(200).json({
status: 200,
Expand All @@ -1011,7 +1008,7 @@ export class ALTStudentService {
}

const data = {
query: `query MyQuery {
query: `query GetClassList {
Group(where: {${filterQuery}}, distinct_on: name) {
name
}
Expand Down
2 changes: 1 addition & 1 deletion src/altStudent/altStudent.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class ALTStudentController {
){
return this.altStudentService.getBlockList(request,body,response);
}
@Post("/getSchooList")
@Post("/getSchoolList")
@UsePipes(ValidationPipe)
@UseInterceptors(ClassSerializerInterceptor, CacheInterceptor)
@ApiBasicAuth("access-token")
Expand Down

0 comments on commit d8adb05

Please sign in to comment.