mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add call for checkpid on gdt server
This commit is contained in:
parent
c868ac93b5
commit
660e1e4b68
@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
|
||||
import { Resolver, Query, Args, Ctx, Authorized } from 'type-graphql'
|
||||
import { Resolver, Query, Args, Ctx, Authorized, Arg } from 'type-graphql'
|
||||
import { getCustomRepository } from 'typeorm'
|
||||
import CONFIG from '../../config'
|
||||
import { GdtEntryList } from '../model/GdtEntryList'
|
||||
@ -32,4 +32,16 @@ export class GdtResolver {
|
||||
}
|
||||
return new GdtEntryList(resultGDT.data)
|
||||
}
|
||||
|
||||
@Authorized()
|
||||
@Query(() => Number)
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async checkPid(@Arg('pid') id: number): Promise<number> {
|
||||
// load user
|
||||
const resultPID = await apiGet(`${CONFIG.GDT_API_URL}/publishers/checkPidApi/${id}`)
|
||||
if (!resultPID.success) {
|
||||
throw new Error(resultPID.data)
|
||||
}
|
||||
return resultPID
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user