Skip to content

Commit

Permalink
Merge pull request #41 from hypersign-protocol/bug/fix
Browse files Browse the repository at this point in the history
fixed issue of null tenanturl
  • Loading branch information
varsha766 authored Oct 15, 2024
2 parents 12a3a88 + bf0c928 commit c428718
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
39 changes: 28 additions & 11 deletions src/app-auth/repositories/app.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ export class AppRepository {
],
},
'://',
'$subdomain',
'.',
{
$cond: {
if: { $ifNull: ['$subdomain', false] },
then: { $concat: ['$subdomain', '.'] },
else: '',
},
},
{
$arrayElemAt: [
{
Expand Down Expand Up @@ -94,13 +99,25 @@ export class AppRepository {
{
$set: {
tenantUrl: {
$concat: [
'$serviceDomainProtocol',
'//:',
'$subdomain',
'.',
'$serviceDomainHostname',
],
$cond: {
if: { $ifNull: ['$subdomain', false] },
then: {
$concat: [
'$serviceDomainProtocol',
'//:',
'$subdomain',
'.',
'$serviceDomainHostname',
],
},
else: {
$concat: [
'$serviceDomainProtocol',
'//:',
'$serviceDomainHostname',
],
},
},
},
},
},
Expand All @@ -112,11 +129,11 @@ export class AppRepository {
'findOne() method: starts, finding particular app from db',
'AppRepository',
);
const aggrerationPipeline = [
const aggregationPipeline = [
{ $match: appFilterQuery },
...this.getTenantUrlAggeration(),
];
const apps = await this.appModel.aggregate(aggrerationPipeline);
const apps = await this.appModel.aggregate(aggregationPipeline);
return apps[0];
}
async find(appsFilterQuery: FilterQuery<App>): Promise<App[]> {
Expand Down
1 change: 0 additions & 1 deletion src/app-auth/services/app-auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ export class AppAuthService {
appData: App,
apiSecretKey?: string,
): createAppResponse {
console.log(appData);
const appResponse: createAppResponse = {
...appData['_doc'],
apiSecretKey,
Expand Down
2 changes: 1 addition & 1 deletion src/supported-service/services/iServiceList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const DASHBOARD_INFO = Object.freeze({
});
export const QUEST_SERVICE_INFO = Object.freeze({
type: SERVICE_TYPES.QUEST,
description: 'EIKO Service',
description: 'Verify on-chain and off-chain tasks of your users',
name: 'QUEST',
swaggerAPIDocPath: '/api',
baseDomain: 'https://api.eiko.zone',
Expand Down

0 comments on commit c428718

Please sign in to comment.