diff --git a/database/knexfile.js b/database/knexfile.js index e5ba8a1..c213af2 100644 --- a/database/knexfile.js +++ b/database/knexfile.js @@ -3,7 +3,7 @@ const env = require('./database-env') module.exports = { client: 'pg', connection: env.PGURI, - searchPath: [env.PGSCHEMA], + searchPath: [env.PGSCHEMA, 'public'], migrations: { tableName: 'knex_migrations', schemaName: env.PGSCHEMA diff --git a/database/layer/admin-persona.js b/database/layer/admin-persona.js index fe5fcc8..da8aaaa 100644 --- a/database/layer/admin-persona.js +++ b/database/layer/admin-persona.js @@ -1,6 +1,6 @@ const { PGPool } = require('./pg_pool') const pool = new PGPool() -const { usherDb } = require('../../database/layer/knex') +const { usherDb } = require('./knex') const { pgErrorHandler } = require('../utils/pgErrorHandler') const insertPersona = async (tenantName, issClaim, subClaim, userContext) => { @@ -66,7 +66,7 @@ const insertPersonaByTenantKey = async (tenantKey, subClaim, userContext = '') = try { const [persona] = await usherDb('personas') .insert({ tenantkey: tenantKey, sub_claim: subClaim, user_context: userContext }) - .returning('*') + .returning(['key', 'sub_claim', 'tenantkey', 'user_context', 'created_at']) return persona } catch (err) { throw pgErrorHandler(err) diff --git a/server/the-usher-openapi-spec.yaml b/server/the-usher-openapi-spec.yaml index 853c6fa..14f947b 100644 --- a/server/the-usher-openapi-spec.yaml +++ b/server/the-usher-openapi-spec.yaml @@ -799,8 +799,6 @@ components: - client_id: client-app2 clientname: Client Application 2 -# PERSONAS -#--------------------- Persona: type: object properties: @@ -1057,14 +1055,14 @@ components: message: Not Found Conflict: - description: Resource already exist + description: Resource already exists content: application/json: schema: $ref: '#/components/schemas/Error' example: code: 409 - message: Resource already exist! + message: Resource already exists! UnsupportedMediaType: description: The request entity has a media type which the server or resource does not support