Fixed create Document
This commit is contained in:
parent
8ca1356912
commit
855334dbd8
4
package-lock.json
generated
4
package-lock.json
generated
@ -16,7 +16,7 @@
|
|||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"jsonwebtoken": "^9.0.0",
|
"jsonwebtoken": "^9.0.0",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.33",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.36",
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
"next": "^13.1.5",
|
"next": "^13.1.5",
|
||||||
"node-cache": "^5.1.2",
|
"node-cache": "^5.1.2",
|
||||||
@ -3615,7 +3615,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/le-coffre-resources": {
|
"node_modules/le-coffre-resources": {
|
||||||
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#cabb4c6c05258d5725cb5747f9cb8335915edf10",
|
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#90ed41d1239cb915defec195cf0e1363ea157d36",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"jsonwebtoken": "^9.0.0",
|
"jsonwebtoken": "^9.0.0",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.35",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.37",
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
"next": "^13.1.5",
|
"next": "^13.1.5",
|
||||||
"node-cache": "^5.1.2",
|
"node-cache": "^5.1.2",
|
||||||
|
@ -47,6 +47,8 @@ export default class DocumentsController extends ApiController {
|
|||||||
try {
|
try {
|
||||||
//init Document resource with request body values
|
//init Document resource with request body values
|
||||||
const documentEntity = Document.hydrate<Document>(req.body);
|
const documentEntity = Document.hydrate<Document>(req.body);
|
||||||
|
console.log(documentEntity);
|
||||||
|
|
||||||
|
|
||||||
//validate document
|
//validate document
|
||||||
await validateOrReject(documentEntity, { groups: ["createDocument"], forbidUnknownValues: false });
|
await validateOrReject(documentEntity, { groups: ["createDocument"], forbidUnknownValues: false });
|
||||||
|
@ -32,7 +32,7 @@ export default class FilesRepository extends BaseRepository {
|
|||||||
data: {
|
data: {
|
||||||
document: {
|
document: {
|
||||||
connect: {
|
connect: {
|
||||||
uid: file.document.uid,
|
uid: file.document!.uid,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
file_path: file.file_path,
|
file_path: file.file_path,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user