Skip to content

Commit ccb2cd7

Browse files
authored
Fix dependencies (#19)
* fix: invalid dependencies * fix: wrong path * fix: build failed because jsx used, not tsx
1 parent e8247e8 commit ccb2cd7

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ COPY --from=builder /opt/app/node_modules /opt/app/node_modules
2020
CMD node /opt/app/index.js
2121

2222

23-
FROM node:16 as dev
23+
FROM node:lts-alpine as dev
2424

2525
ENV NODE_ENV development
2626

27-
WORKDIR /soroka-backend
27+
WORKDIR /opt/app
2828

29-
COPY --from=builder /opt/app/ /soroka-backend
29+
COPY --from=builder /opt/app/ /opt/app
3030

3131
RUN npm install
3232

src/admin/components/import-action-component.jsx src/admin/components/import-action-component.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22

33
const ImportAction = () => {
4-
async function submitForm(form) {
4+
async function submitForm(form: HTMLFormElement) {
55
const formData = new FormData(form)
66

77
const response = await fetch(
@@ -24,7 +24,7 @@ const ImportAction = () => {
2424
style={{display: "flex", flexDirection: "column"}}
2525
onSubmit={(event) => {
2626
event.preventDefault()
27-
submitForm(event.target)
27+
submitForm(event.currentTarget)
2828
}}
2929
>
3030
<label style={{fontSize: "1.5rem"}} htmlFor="csvFile">

src/routes/admin/admin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import AdminJS from 'adminjs'
22
import AdminJSExpress from '@adminjs/express'
3-
import AdminJSSequelize = require('@adminjs/sequelize')
3+
import * as AdminJSSequelize from '@adminjs/sequelize'
44
import sequelize from '../../providers/db'
55

66
AdminJS.registerAdapter(AdminJSSequelize)
@@ -36,7 +36,7 @@ const adminJs = new AdminJS({
3636
icon: 'Upload',
3737
isVisible: true,
3838
handler: async () => { console.log() },
39-
component: AdminJS.bundle('../../admin/components/import-action-component.jsx'),
39+
component: AdminJS.bundle('../../admin/components/import-action-component'),
4040
},
4141
},
4242
},

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"esModuleInterop": true,
88
"strictPropertyInitialization": false,
99
"experimentalDecorators": true,
10-
"emitDecoratorMetadata": true
10+
"emitDecoratorMetadata": true,
11+
"jsx": "react"
1112
}
1213
}
13-

0 commit comments

Comments
 (0)