Skip to content

Commit b6bb5b4

Browse files
icepcpCopilot
andcommitted
edit imagefield
Co-authored-by: Copilot <copilot@github.com>
1 parent 3698925 commit b6bb5b4

3 files changed

Lines changed: 28 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ v2 has both frontend and backend hosted on Azure, and therefore may require more
2424

2525
**Backend**
2626
- Removed "attached pdf" text as pdf is no longer generated on server side, and instead on lamda. We dont use aws
27+
- modified imagefield, as since we do not use s3 for images, rather it is hosted somewhere, it will try to validate, fail validation, and come up with error "Error: [Please ensure that your url is in the valid format]. Please refresh and try again. If you still need help, email us at form@open.gov.sg."
2728

2829
**Frontend**
2930
- All mostly just name changes so it is more branded for buildingblocs

‎v1/backend/src/app/models/field/imageField.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// myat: v2 azre migration: cant remember why this was added
1+
// myat: v2 azre migration: this is added cus if you try to save the
2+
// form without this, it will throw an error that somethings wrong
23
import { Schema } from 'mongoose'
34

45
import { IImageFieldSchema } from '../../../types'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Schema } from 'mongoose'
2+
3+
import { IImageFieldSchema } from '../../../types'
4+
5+
const createImageFieldSchema = () => {
6+
return new Schema<IImageFieldSchema>({
7+
url: {
8+
type: String,
9+
required: true
10+
},
11+
fileMd5Hash: {
12+
type: String,
13+
required: true,
14+
},
15+
name: {
16+
type: String,
17+
required: true,
18+
},
19+
size: {
20+
type: String,
21+
required: true,
22+
},
23+
})
24+
}
25+
export default createImageFieldSchema

0 commit comments

Comments
 (0)