Skip to content

Commit

Permalink
Merge pull request #4010 from airqo-platform/staging
Browse files Browse the repository at this point in the history
move to production
  • Loading branch information
Baalmart authored Dec 5, 2024
2 parents 1c7e9a8 + 73463ae commit a7e2441
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion k8s/auth-service/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app:
replicaCount: 3
image:
repository: eu.gcr.io/airqo-250220/airqo-auth-api
tag: prod-b52e8933-1733336119
tag: prod-1c7e9a8e-1733346549
nameOverride: ''
fullnameOverride: ''
podAnnotations: {}
Expand Down
2 changes: 1 addition & 1 deletion k8s/exceedance/values-prod-airqo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ app:
configmap: env-exceedance-production
image:
repository: eu.gcr.io/airqo-250220/airqo-exceedance-job
tag: prod-b52e8933-1733336119
tag: prod-1c7e9a8e-1733346549
nameOverride: ''
fullnameOverride: ''
2 changes: 1 addition & 1 deletion k8s/exceedance/values-prod-kcca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ app:
configmap: env-exceedance-production
image:
repository: eu.gcr.io/airqo-250220/kcca-exceedance-job
tag: prod-b52e8933-1733336119
tag: prod-1c7e9a8e-1733346549
nameOverride: ''
fullnameOverride: ''
2 changes: 1 addition & 1 deletion k8s/predict/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ images:
predictJob: eu.gcr.io/airqo-250220/airqo-predict-job
trainJob: eu.gcr.io/airqo-250220/airqo-train-job
predictPlaces: eu.gcr.io/airqo-250220/airqo-predict-places-air-quality
tag: prod-b52e8933-1733336119
tag: prod-1c7e9a8e-1733346549
api:
name: airqo-prediction-api
label: prediction-api
Expand Down
2 changes: 1 addition & 1 deletion k8s/spatial/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app:
replicaCount: 3
image:
repository: eu.gcr.io/airqo-250220/airqo-spatial-api
tag: prod-b52e8933-1733336119
tag: prod-1c7e9a8e-1733346549
nameOverride: ''
fullnameOverride: ''
podAnnotations: {}
Expand Down
2 changes: 1 addition & 1 deletion k8s/workflows/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ images:
initContainer: eu.gcr.io/airqo-250220/airqo-workflows-xcom
redisContainer: eu.gcr.io/airqo-250220/airqo-redis
containers: eu.gcr.io/airqo-250220/airqo-workflows
tag: prod-b52e8933-1733336119
tag: prod-1c7e9a8e-1733346549
nameOverride: ''
fullnameOverride: ''
podAnnotations: {}
Expand Down
2 changes: 2 additions & 0 deletions src/auth-service/controllers/create-network.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ const createNetwork = {
return res.status(status).json({
success: true,
message: result.message,
total_assigned_users: result.totalCount,
assigned_users: result.data,
});
} else if (result.success === false) {
Expand Down Expand Up @@ -770,6 +771,7 @@ const createNetwork = {
return res.status(status).json({
success: true,
message: result.message,
total_available_users: result.totalCount,
available_users: result.data,
});
} else if (result.success === false) {
Expand Down
8 changes: 6 additions & 2 deletions src/auth-service/models/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ UserSchema.statics = {
delete filter.category;
}
logObject("the filter being used", filter);
const totalCount = await this.countDocuments(filter).exec();

const response = await this.aggregate()
.match(filter)
.lookup({
Expand Down Expand Up @@ -907,21 +909,23 @@ UserSchema.statics = {
.project(inclusionProjection)
.project(exclusionProjection)
.sort({ createdAt: -1 })
.skip(skip ? skip : 0)
.limit(limit ? limit : parseInt(constants.DEFAULT_LIMIT))
.skip(skip ? parseInt(skip) : 0)
.limit(limit ? parseInt(limit) : parseInt(constants.DEFAULT_LIMIT))
.allowDiskUse(true);
if (!isEmpty(response)) {
return {
success: true,
message: "successfully retrieved the user details",
data: response,
totalCount,
status: httpStatus.OK,
};
} else if (isEmpty(response)) {
return {
success: true,
message: "no users exist",
data: [],
totalCount,
status: httpStatus.OK,
};
}
Expand Down
8 changes: 6 additions & 2 deletions src/auth-service/utils/create-network.js
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ const createNetwork = {
},
listAvailableUsers: async (request, next) => {
try {
const { tenant } = request.query;
const { tenant, skip, limit } = request.query;
const { net_id } = request.params;
const network = await NetworkModel(tenant).findById(net_id);
if (!network) {
Expand All @@ -1040,6 +1040,8 @@ const createNetwork = {
let responseFromListAvailableUsers = await UserModel(tenant).list(
{
filter,
skip,
limit,
},
next
);
Expand All @@ -1061,7 +1063,7 @@ const createNetwork = {
},
listAssignedUsers: async (request, next) => {
try {
const { tenant } = request.query;
const { tenant, skip, limit } = request.query;
const { net_id } = request.params;

const network = await NetworkModel(tenant).findById(net_id);
Expand All @@ -1082,6 +1084,8 @@ const createNetwork = {
let responseFromListAssignedUsers = await UserModel(tenant).list(
{
filter,
skip,
limit,
},
next
);
Expand Down

0 comments on commit a7e2441

Please sign in to comment.