mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
better function name
This commit is contained in:
parent
e5e22c394d
commit
644a373847
@ -58,7 +58,7 @@ export class BackendClient {
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
method: 'POST',
|
||||
method: 'GET',
|
||||
jsonSerializer: {
|
||||
parse: JSON.parse,
|
||||
stringify: JSON.stringify,
|
||||
@ -72,12 +72,15 @@ export class BackendClient {
|
||||
return BackendClient.instance
|
||||
}
|
||||
|
||||
public async homeCommunityUUid(): Promise<CommunityDraft> {
|
||||
public async getHomeCommunityDraft(): Promise<CommunityDraft> {
|
||||
logger.info('check home community on backend')
|
||||
this.client.setHeader('token', await this.createJWTToken())
|
||||
const { data, errors } = await this.client.rawRequest<Community>(communityByForeign, {
|
||||
foreign: false,
|
||||
})
|
||||
const { data, errors } = await this.client.rawRequest<Community>(
|
||||
communityByForeign,
|
||||
{
|
||||
foreign: false,
|
||||
},
|
||||
{ authorization: 'Bearer ' + (await this.createJWTToken()) },
|
||||
)
|
||||
if (errors) {
|
||||
throw new LogError('error getting home community from backend', errors)
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ async function waitForServer(
|
||||
|
||||
try {
|
||||
// Make a HEAD request to the server
|
||||
return await backend.homeCommunityUUid()
|
||||
return await backend.getHomeCommunityDraft()
|
||||
} catch (error) {
|
||||
logger.info('Server is not reachable: ', error)
|
||||
}
|
||||
@ -51,7 +51,7 @@ async function main() {
|
||||
// wait for backend server to be ready
|
||||
await waitForServer(backend, 1000, 8)
|
||||
|
||||
const communityDraft = await backend.homeCommunityUUid()
|
||||
const communityDraft = await backend.getHomeCommunityDraft()
|
||||
const addCommunityContext = new AddCommunityContext(communityDraft)
|
||||
await addCommunityContext.run()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user