mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
rework review comments
This commit is contained in:
parent
569a89ce2d
commit
e44da4d6a3
@ -9,10 +9,11 @@ import { LogError } from '@/server/LogError'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
import { GmsUser } from './model/GmsUser'
|
||||
import { ensureUrlEndsWithSlash } from '@/util/utilities'
|
||||
|
||||
/*
|
||||
export async function communityList(): Promise<GmsCommunity[] | string | undefined> {
|
||||
const baseUrl = CONFIG.GMS_URL.endsWith('/') ? CONFIG.GMS_URL : CONFIG.GMS_URL.concat('/')
|
||||
const baseUrl = ensureUrlEndsWithSlash(CONFIG.GMS_URL)
|
||||
const service = 'community/list?page=1&perPage=20'
|
||||
const config = {
|
||||
headers: {
|
||||
@ -44,7 +45,7 @@ export async function communityList(): Promise<GmsCommunity[] | string | undefin
|
||||
}
|
||||
|
||||
export async function userList(): Promise<GmsUser[] | string | undefined> {
|
||||
const baseUrl = CONFIG.GMS_URL.endsWith('/') ? CONFIG.GMS_URL : CONFIG.GMS_URL.concat('/')
|
||||
const baseUrl = ensureUrlEndsWithSlash(CONFIG.GMS_URL)
|
||||
const service = 'community-user/list?page=1&perPage=20'
|
||||
const config = {
|
||||
headers: {
|
||||
@ -80,7 +81,7 @@ export async function userList(): Promise<GmsUser[] | string | undefined> {
|
||||
}
|
||||
|
||||
export async function userByUuid(uuid: string): Promise<GmsUser[] | string | undefined> {
|
||||
const baseUrl = CONFIG.GMS_URL.endsWith('/') ? CONFIG.GMS_URL : CONFIG.GMS_URL.concat('/')
|
||||
const baseUrl = ensureUrlEndsWithSlash(CONFIG.GMS_URL)
|
||||
const service = 'community-user/list?page=1&perPage=20'
|
||||
const config = {
|
||||
headers: {
|
||||
@ -118,9 +119,7 @@ export async function userByUuid(uuid: string): Promise<GmsUser[] | string | und
|
||||
|
||||
export async function createGmsUser(apiKey: string, user: GmsUser): Promise<boolean> {
|
||||
if (CONFIG.GMS_ACTIVE) {
|
||||
const baseUrl = CONFIG.GMS_API_URL.endsWith('/')
|
||||
? CONFIG.GMS_API_URL
|
||||
: CONFIG.GMS_API_URL.concat('/')
|
||||
const baseUrl = ensureUrlEndsWithSlash(CONFIG.GMS_API_URL)
|
||||
const service = 'community-user'
|
||||
const config = {
|
||||
headers: {
|
||||
@ -154,9 +153,7 @@ export async function createGmsUser(apiKey: string, user: GmsUser): Promise<bool
|
||||
|
||||
export async function updateGmsUser(apiKey: string, user: GmsUser): Promise<boolean> {
|
||||
if (CONFIG.GMS_ACTIVE) {
|
||||
const baseUrl = CONFIG.GMS_API_URL.endsWith('/')
|
||||
? CONFIG.GMS_API_URL
|
||||
: CONFIG.GMS_API_URL.concat('/')
|
||||
const baseUrl = ensureUrlEndsWithSlash(CONFIG.GMS_API_URL)
|
||||
const service = 'community-user'
|
||||
const config = {
|
||||
headers: {
|
||||
@ -193,9 +190,7 @@ export async function verifyAuthToken(
|
||||
communityUuid: string,
|
||||
token: string,
|
||||
): Promise<string> {
|
||||
const baseUrl = CONFIG.GMS_API_URL.endsWith('/')
|
||||
? CONFIG.GMS_API_URL
|
||||
: CONFIG.GMS_API_URL.concat('/')
|
||||
const baseUrl = ensureUrlEndsWithSlash(CONFIG.GMS_API_URL)
|
||||
const service = 'verify-auth-token?token='.concat(token).concat('&uuid=').concat(communityUuid)
|
||||
const config = {
|
||||
headers: {
|
||||
|
||||
@ -29,3 +29,7 @@ export function resetInterface<T extends Record<string, any>>(obj: T): T {
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
export const ensureUrlEndsWithSlash = (url: string): string => {
|
||||
return url.endsWith('/') ? url : url.concat('/')
|
||||
}
|
||||
|
||||
@ -125,3 +125,5 @@ GMS_ACTIVE=false
|
||||
#GMS_API_URL=http://54.176.169.179:3071
|
||||
GMS_API_URL=http://localhost:4044/
|
||||
GMS_DASHBOARD_URL=http://localhost:8080/
|
||||
GMS_WEBHOOK_SECRET=secret
|
||||
GMS_CREATE_USER_THROW_ERRORS=false
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@ -33,7 +33,7 @@
|
||||
<span class="ml-2">{{ $t('navigation.info') }}</span>
|
||||
</b-nav-item>
|
||||
<b-nav-item to="/usersearch" active-class="activeRoute">
|
||||
<b-img src="/img/svg/loupe.png" height="20" class="svg-icon" />
|
||||
<b-img src="/img/loupe.png" height="20" />
|
||||
<span class="ml-2">{{ $t('navigation.usersearch') }}</span>
|
||||
</b-nav-item>
|
||||
</b-nav>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user