Skip to content

Commit

Permalink
Merge pull request #41 from Instituto-Maua-de-Tecnologia/dev
Browse files Browse the repository at this point in the history
Subindo dev para prod
  • Loading branch information
FelipeCarillo authored Aug 21, 2024
2 parents f72cfb0 + 012dcba commit 08dab28
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 0 additions & 4 deletions iac/lib/lambda_stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export class LambdaStack extends Construct {
return string.toLowerCase().split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("_");
}

let layers: lambda.ILayerVersion[]
let function_lambda: lambda.Function;

function_lambda = new lambda_js.NodejsFunction(
Expand Down Expand Up @@ -80,9 +79,6 @@ export class LambdaStack extends Construct {
super(scope, id);

let origins = ["*"];
if (environment_variables["STAGE"] === "prod") {
origins = [environment_variables["DOMAIN"]];
}

this.create_moderator = this.create_lambda(
"create_moderator",
Expand Down
4 changes: 2 additions & 2 deletions src/core/helpers/http/http_codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class HttpRequest {
} else {
body["queryStringParameters"] = event.queryStringParameters;
}

return body;
}
}
Expand Down Expand Up @@ -111,7 +111,7 @@ export class Unprocessable_Entity extends HttpResponse {
constructor(message: string) {
super(422, null, message);
}
}
}

export class Conflict extends HttpResponse {
constructor(message: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/repositories/database/dtos/ActivityDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class ActivityDTO {
created_at: application.user.created_at,
updated_at: application.user.updated_at
}) : undefined,
status: application.status === 1
status: application.status == 1
})) : []
});
}
Expand Down
15 changes: 7 additions & 8 deletions src/core/repositories/database/repositories/ActivityRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,23 +437,22 @@ export class ActivityRepo implements IActivityRepo {
}

async update_users_activity_status(activity_id: string, users: { user_id: string, status: boolean }[]): Promise<boolean> {
let response = true;

users.forEach(async user => {
const updatePromises = users.map(async (user) => {
const status = user.status == true ? false : true;
const response_user = await ActivityApplication.update({
status: !user.status
status: status
}, {
where: {
activity_id: activity_id,
user_id: user.user_id
}
});
if (response_user[0] === 0) {
response = false;
}
return response_user[0] !== 0;
});

return response;
const results = await Promise.all(updatePromises);

return results.every(result => result === true);
}

async get_all_activities_catalog(): Promise<{ title: string; logo: string; type_activity: ActivityTypeEnum; }[]> {
Expand Down
3 changes: 2 additions & 1 deletion src/core/structure/entities/Institution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class Institution {
return {
id: this.id,
name: this.name,
description: this.description,
email: this.email,
countries: this.countries,
images: this.images,
Expand Down Expand Up @@ -134,4 +135,4 @@ export class Institution {
}
return social_medias;
}
}
}

0 comments on commit 08dab28

Please sign in to comment.