Skip to content

Commit

Permalink
Added jest to ESLint and fixed serialization for lists of models
Browse files Browse the repository at this point in the history
  • Loading branch information
DCMattyG committed Oct 7, 2023
1 parent b662a17 commit 5e4ba45
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion engine/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class JSONPatch(BaseModel):

VNetsUpdate = Annotated[List[str], None]

ExtNetsUpdate = Annotated[list[ExtNet], None]
ExtNetsUpdate = Annotated[List[ExtNet], None]

DeleteExtNetReq = Annotated[List[str], None]

Expand Down
4 changes: 2 additions & 2 deletions engine/app/routers/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ async def update_space(
raise HTTPException(status_code=400, detail="Invalid space name.")

try:
patch = jsonpatch.JsonPatch(updates.model_dump())
patch = jsonpatch.JsonPatch([x.model_dump() for x in updates])
except jsonpatch.InvalidJsonPatch:
raise HTTPException(status_code=500, detail="Invalid JSON patch, please review and try again.")

Expand Down Expand Up @@ -928,7 +928,7 @@ async def update_block(
raise HTTPException(status_code=400, detail="Invalid block name.")

try:
patch = jsonpatch.JsonPatch(updates.model_dump())
patch = jsonpatch.JsonPatch([x.model_dump() for x in updates])
except jsonpatch.InvalidJsonPatch:
raise HTTPException(status_code=500, detail="Invalid JSON patch, please review and try again.")

Expand Down
1 change: 1 addition & 0 deletions ui/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"env": {
"node": true,
"browser": true,
"jest": true,
"es2021": true
},
"settings": {
Expand Down
2 changes: 1 addition & 1 deletion ui/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default () => {
// cache: false,
lintOnStart: true,
lintInWorker: true,
include: ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"],
include: ['src/**/*.js', 'src/**/*.jsx', 'src/**/*.ts', 'src/**/*.tsx'],
exclude: []
}
),
Expand Down

0 comments on commit 5e4ba45

Please sign in to comment.