Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
e60b011f
Commit
e60b011f
authored
Apr 08, 2021
by
Manuel Herold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[businessLogic] fixed 500 error for enum query
parent
cbb4d514
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
enum_repository.py
...hub/business-logic-microservice/app/db/enum_repository.py
+1
-1
enum.py
...pation-hub/business-logic-microservice/app/routes/enum.py
+2
-5
No files found.
src/participation-hub/business-logic-microservice/app/db/enum_repository.py
View file @
e60b011f
...
@@ -34,7 +34,7 @@ class EnumRepository(MongoRepositoryBase):
...
@@ -34,7 +34,7 @@ class EnumRepository(MongoRepositoryBase):
return
[
Enum
.
from_serializable_dict
(
row
)
for
row
in
list
(
result
)]
return
[
Enum
.
from_serializable_dict
(
row
)
for
row
in
list
(
result
)]
def
all_
instances
(
self
,
name
:
str
,
use_case
:
str
,
table
:
str
)
->
Enum
:
def
all_
for_use_case_and_table_and_name
(
self
,
name
:
str
,
use_case
:
str
,
table
:
str
)
->
Enum
:
result
=
list
(
super
()
.
get_entries
(
self
.
_enum_collection
,
selection
=
{
result
=
list
(
super
()
.
get_entries
(
self
.
_enum_collection
,
selection
=
{
"name"
:
name
,
"use_case"
:
use_case
,
"table"
:
table
}))
"name"
:
name
,
"use_case"
:
use_case
,
"table"
:
table
}))
...
...
src/participation-hub/business-logic-microservice/app/routes/enum.py
View file @
e60b011f
...
@@ -32,12 +32,9 @@ def one(use_case: str, table: str, name: str):
...
@@ -32,12 +32,9 @@ def one(use_case: str, table: str, name: str):
table - Required : unique identifier of the Table the Enum belongs to
table - Required : unique identifier of the Table the Enum belongs to
name - Required : unique identifier for the Enum
name - Required : unique identifier for the Enum
'''
'''
enum
=
enum_repository
.
on
e
(
name
,
use_case
,
table
)
enum
s
=
enum_repository
.
all_for_use_case_and_table_and_nam
e
(
name
,
use_case
,
table
)
if
enum
==
None
:
return
Response
(
status
=
200
,
response
=
json
.
dumps
([
enum
.
to_serializable_dict
()
for
enum
in
enums
]))
return
Response
(
status
=
404
,
response
=
f
"Enum with name '{name}' does not exist!"
)
return
Response
(
status
=
200
,
response
=
json
.
dumps
(
enum
.
to_serializable_dict
()))
def
put_new
(
use_case
:
str
,
table
:
str
,
name
:
str
,
value
:
str
):
def
put_new
(
use_case
:
str
,
table
:
str
,
name
:
str
,
value
:
str
):
'''
'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment