Use auto profile generation

This commit is contained in:
Yarmo Mackenbach 2023-02-25 20:09:45 +01:00
parent 7b35f99b1c
commit 42210c6ac0
2 changed files with 4 additions and 12 deletions

View file

@ -30,7 +30,7 @@ more information on this, and how to apply and follow the GNU AGPL, see <https:/
import express from 'express' import express from 'express'
import { check, validationResult } from 'express-validator' import { check, validationResult } from 'express-validator'
import Ajv from 'ajv' import Ajv from 'ajv'
import { generateWKDProfile, generateHKPProfile } from '../../server/index.js' import { generateWKDProfile, generateHKPProfile, generateAutoProfile } from '../../server/index.js'
import * as dotenv from 'dotenv' import * as dotenv from 'dotenv'
dotenv.config() dotenv.config()
@ -310,11 +310,7 @@ router.get('/profile/fetch',
data = await generateHKPProfile(req.query.query) data = await generateHKPProfile(req.query.query)
break break
default: default:
if (req.query.query.includes('@')) { data = await generateAutoProfile(req.query.query)
data = await generateWKDProfile(req.query.query)
} else {
data = await generateHKPProfile(req.query.query)
}
break break
} }

View file

@ -30,7 +30,7 @@ more information on this, and how to apply and follow the GNU AGPL, see <https:/
import express from 'express' import express from 'express'
import { check, validationResult } from 'express-validator' import { check, validationResult } from 'express-validator'
import Ajv from 'ajv' import Ajv from 'ajv'
import { generateWKDProfile, generateHKPProfile } from '../../server/index.js' import { generateWKDProfile, generateHKPProfile, generateAutoProfile } from '../../server/index.js'
import * as dotenv from 'dotenv' import * as dotenv from 'dotenv'
dotenv.config() dotenv.config()
@ -283,11 +283,7 @@ router.get('/fetch',
data = await generateHKPProfile(req.query.query) data = await generateHKPProfile(req.query.query)
break break
default: default:
if (req.query.query.includes('@')) { data = await generateAutoProfile(req.query.query)
data = await generateWKDProfile(req.query.query)
} else {
data = await generateHKPProfile(req.query.query)
}
break break
} }