Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix(api): 🐛 merge construct props and function props correctly
Browse files Browse the repository at this point in the history
- the root function props were overriding the route-specific ones
  • Loading branch information
ap0nia committed Dec 21, 2023
1 parent ffe387c commit 09657ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/api/src/routes/v1/rest/websoc/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { constructs, esbuildOptions } from "../../../../../bronya.config";

export const overrides: ApiPropsOverride = {
constructs: {
...constructs,
functionProps: (scope, id) => ({
...constructs.functionProps(scope, id),

Check failure on line 17 in apps/api/src/routes/v1/rest/websoc/+config.ts

View workflow job for this annotation

GitHub Actions / Check for TypeScript errors

Cannot invoke an object which is possibly 'undefined'.
role: new Role(scope, `${id}-v1-rest-websoc-role`, {
assumedBy: new ServicePrincipal("lambda.amazonaws.com"),
managedPolicies: [
Expand All @@ -33,7 +35,6 @@ export const overrides: ApiPropsOverride = {
},
}),
}),
...constructs,
},
esbuild: {
...esbuildOptions,
Expand Down
3 changes: 2 additions & 1 deletion apps/api/src/routes/v1/rest/websoc/{id}/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { constructs, esbuildOptions } from "../../../../../../bronya.config";

export const overrides: ApiPropsOverride = {
constructs: {
...constructs,
functionProps: (scope, id) => ({
...constructs.functionProps(scope, id),

Check failure on line 17 in apps/api/src/routes/v1/rest/websoc/{id}/+config.ts

View workflow job for this annotation

GitHub Actions / Check for TypeScript errors

Cannot invoke an object which is possibly 'undefined'.
role: new Role(scope, `${id}-v1-rest-websoc-id-role`, {
assumedBy: new ServicePrincipal("lambda.amazonaws.com"),
managedPolicies: [
Expand All @@ -33,7 +35,6 @@ export const overrides: ApiPropsOverride = {
},
}),
}),
...constructs,
},
esbuild: {
...esbuildOptions,
Expand Down

0 comments on commit 09657ee

Please sign in to comment.