Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow empty task id and osm id for new geopoint #1774

Merged
merged 4 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/backend/app/central/central_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,12 @@ async def get_entities_data(

# Rename '__id' to 'id'
flattened_dict["id"] = flattened_dict.pop("__id")

# convert empty str osm_id to None
# when new entities are created osm_id will be empty
if flattened_dict.get("osm_id", "") == "":
flattened_dict["osm_id"] = None

all_entities.append(flattened_dict)

return all_entities
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/views/ProjectSubmissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ProjectSubmissions = () => {
const state = useAppSelector((state) => state.project);
const projectInfo = useAppSelector((state) => state.project.projectInfo);
const entityList = useAppSelector((state) => state.project.entityOsmMap);
const updatedEntities = entityList?.filter((entity) => entity?.updated_at && entity?.status > 1);
const updatedEntities = entityList?.filter((entity) => entity?.status > 1);

//Fetch project for the first time
useEffect(() => {
Expand Down