Skip to content

Commit 8d89224

Browse files
committed
refactor, fix bug reading existing attachments
1 parent ae938db commit 8d89224

File tree

20 files changed

+783
-740
lines changed

20 files changed

+783
-740
lines changed

packages/backend/src/apps/postman/common/parameters.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,26 +80,10 @@ export const transactionalEmailFields: IField[] = [
8080
key: 'attachments',
8181
description:
8282
'Check supported file types [here](https://guide.postman.gov.sg/email-api-guide/programmatic-email-api/send-email-api/attachments#list-of-supported-attachment-file-types).\nPlease note that the maximum file size for each file is 2MB, and the total size of all attachments cannot exceed 10MB.',
83-
type: 'attachment-multicheckbox' as const,
83+
type: 'attachment' as const,
8484
required: false,
8585
variables: true,
8686
variableTypes: ['file'],
87-
subFields: [
88-
{
89-
label: 'FormSG attachments',
90-
key: 'formsgAttachments',
91-
type: 'string' as const,
92-
required: false,
93-
variables: true,
94-
},
95-
{
96-
label: 'Uploaded attachments',
97-
key: 'uploadedAttachments',
98-
type: 'string' as const,
99-
required: false,
100-
variables: false,
101-
},
102-
],
10387
},
10488
]
10589

packages/backend/src/graphql/mutations/generate-presigned-url.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { randomUUID } from 'crypto'
22

3-
import appConfig from '@/config/app'
43
import { COMMON_S3_BUCKET, getPresignedUrl } from '@/helpers/s3'
54
import Flow from '@/models/flow'
65

@@ -25,14 +24,7 @@ const generatePresignedUrl: MutationResolvers['generatePresignedUrl'] = async (
2524
manualUpload: manualUpload.toString(),
2625
})
2726

28-
const customUrl = url.replace(
29-
new RegExp(
30-
`https://${COMMON_S3_BUCKET}\\.s3\\.[a-z0-9-]+\\.amazonaws\\.com`,
31-
),
32-
`https://upload-${appConfig.appEnv}.plumber.gov.sg`,
33-
)
34-
35-
return { url: customUrl, s3Id: `s3:${COMMON_S3_BUCKET}:${filePath}` }
27+
return { url, s3Id: `s3:${COMMON_S3_BUCKET}:${filePath}` }
3628
}
3729

3830
export default generatePresignedUrl

packages/backend/src/graphql/schema.graphql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ type FlowTemplateConfig {
379379

380380
type FlowAttachmentConfig {
381381
name: String!
382+
displayedValue: String!
382383
value: String!
383384
size: Int!
384385
updatedAt: String!
@@ -454,6 +455,7 @@ enum NotificationFrequency {
454455

455456
input FlowAttachmentsConfigInput {
456457
name: String!
458+
displayedValue: String!
457459
value: String!
458460
size: Int!
459461
updatedAt: String!

0 commit comments

Comments
 (0)