feat(api): fixed metadata change-case
This commit is contained in:
parent
6460d8d947
commit
37230b1024
2 changed files with 2 additions and 2 deletions
|
|
@ -83,7 +83,7 @@ def __edit(project_id, col_index, colname, new_name):
|
|||
return {"errors": ["custom field not found"]}
|
||||
|
||||
with pg_client.PostgresClient() as cur:
|
||||
if old_metas[col_index]["key"].lower() != new_name:
|
||||
if old_metas[col_index]["key"] != new_name:
|
||||
cur.execute(cur.mogrify(f"""UPDATE public.projects
|
||||
SET {colname} = %(value)s
|
||||
WHERE project_id = %(project_id)s AND deleted_at ISNULL
|
||||
|
|
|
|||
|
|
@ -580,7 +580,7 @@ def add_metadata(projectId: int, data: schemas.MetadataBasicSchema = Body(...),
|
|||
@app.put('/{projectId}/metadata/{index}', tags=["metadata"])
|
||||
def edit_metadata(projectId: int, index: int, data: schemas.MetadataBasicSchema = Body(...),
|
||||
context: schemas.CurrentContext = Depends(OR_context)):
|
||||
return metadata.edit(tenant_id=context.tenant_id, project_id=projectId, index=int(index),
|
||||
return metadata.edit(tenant_id=context.tenant_id, project_id=projectId, index=index,
|
||||
new_name=data.key)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue