Skip to content

Commit

Permalink
Merge pull request #990 from HDRUK/preprod
Browse files Browse the repository at this point in the history
GAT-2058: GAT Live Release - v4.0.1
  • Loading branch information
loki-sinclair-hdruk authored Mar 14, 2023
2 parents ba58565 + b3c2b8a commit 3473b5e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dev_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches:
- 'dev'
# paths:
# - 'Chart.yaml'
# paths:
# - 'Chart.yaml'

env:
PROJECT_ID: '${{ secrets.PROJECT_ID }}' # TODO: update Google Cloud project id.
Expand Down Expand Up @@ -155,4 +155,4 @@ jobs:
channel: ${{ env.SLACK_CHANNEL }}
message: Deploying {{ env.GITHUB_REF_NAME }} branch
if: always()
# If required, use the Cloud Run url output in later steps
# If required, use the Cloud Run url output in later steps
Empty file modified .github/workflows/preprod_deployment.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/prod_deployment.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/uat_deployment.yaml
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v4.0.0
v4.0.1
36 changes: 36 additions & 0 deletions src/resources/search/search.repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import moment from 'moment';
import helperUtil from '../utilities/helper.util';

export async function getObjectResult(type, searchAll, searchQuery, startIndex, maxResults, sort, authorID, form) {

let collection = Data;
if (type === 'course') {
collection = Course;
Expand Down Expand Up @@ -278,6 +279,33 @@ export async function getObjectResult(type, searchAll, searchQuery, startIndex,
as: 'relatedResourcesCourses',
},
},
{
$lookup: {
from: 'datauseregisters',
let: {
pid: '$pid',
},
pipeline: [
{ $unwind: '$relatedObjects' },
{
$match: {
$expr: {
$and: [
{
$eq: ['$relatedObjects.pid', '$$pid'],
},
{
$eq: ['$activeflag', 'active'],
},
],
},
},
},
{ $group: { _id: null, count: { $sum: 1 } } },
],
as: 'relatedResourcesDataUseRegister',
},
},
{
$project: {
_id: 0,
Expand Down Expand Up @@ -353,11 +381,19 @@ export async function getObjectResult(type, searchAll, searchQuery, startIndex,
else: { $first: '$relatedResourcesCourses.count' },
},
},
{
$cond: {
if: { $eq: [{ $size: '$relatedResourcesDataUseRegister' }, 0] },
then: 0,
else: { $first: '$relatedResourcesDataUseRegister.count' },
},
},
],
},
},
},
];

} else {
queryObject = [
{ $match: newSearchQuery },
Expand Down

0 comments on commit 3473b5e

Please sign in to comment.