mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-13 16:47:43 +03:00
2c9a0c1ed2
* feat: add public brain details modal * feat(brain): add subscription route * feat: activate subscription button * feat: add last_update column to brain table * feat: display last update on public brain details page * feat: change RBAC rule for public brains * feat: maintain brain last_update time
19 lines
619 B
Python
19 lines
619 B
Python
from uuid import UUID
|
|
|
|
from models import BrainEntity, get_supabase_db
|
|
from models.databases.supabase.brains import BrainUpdatableProperties
|
|
|
|
from repository.brain.update_brain_last_update_time import update_brain_last_update_time
|
|
|
|
|
|
def update_brain_by_id(brain_id: UUID, brain: BrainUpdatableProperties) -> BrainEntity:
|
|
"""Update a prompt by id"""
|
|
supabase_db = get_supabase_db()
|
|
|
|
brain_update_answer = supabase_db.update_brain_by_id(brain_id, brain)
|
|
if brain_update_answer is None:
|
|
raise Exception("Brain not found")
|
|
|
|
update_brain_last_update_time(brain_id)
|
|
return brain_update_answer
|