add pilots

This commit is contained in:
2024-07-13 11:05:07 -05:00
parent f19f46eebf
commit 251abcfbac
10 changed files with 2006 additions and 19307 deletions

9146
api/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -35,6 +35,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@microsoft/microsoft-graph-types": "^2.40.0",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",

View File

@@ -6,6 +6,7 @@ import {
} from '@noahspan/noahspan-modules';
import { FeatureFlagValue } from '@azure/app-configuration';
import { Public } from '@noahspan/noahspan-modules';
import { Person } from '@microsoft/microsoft-graph-types';
@Controller()
export class AppController {
@@ -56,4 +57,26 @@ export class AppController {
return error;
}
}
@Get('personSearch')
async searchUsers(
@Headers() headers: any,
@Query('search') search: any
): Promise<Person[]> {
try {
const graphToken: string = await this.msGraphService.getMsGraphAuth(
headers.authorization.replace('Bearer ', '')
);
const client: MsGraphClient =
await this.msGraphService.getMsGraphClientDelegated(graphToken);
const results: any = await client
.api(`me/people/?$search=${search}`)
.get();
const personResults: Person[] = results.values ? results.values : [];
return personResults;
} catch (error) {
return error;
}
}
}