fix: clear design cache when activating a design
This commit is contained in:
parent
0724566c05
commit
ce77530efc
|
|
@ -11,6 +11,7 @@ from fastapi import APIRouter, HTTPException
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
from app.config import get_settings
|
from app.config import get_settings
|
||||||
|
from app.api.designs import design_service
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
settings = get_settings()
|
settings = get_settings()
|
||||||
|
|
@ -194,6 +195,9 @@ async def activate_design(slug: str):
|
||||||
content = content.replace("status: draft", "status: active")
|
content = content.replace("status: draft", "status: active")
|
||||||
metadata_path.write_text(content)
|
metadata_path.write_text(content)
|
||||||
|
|
||||||
|
# Clear the design service cache so the new status is picked up
|
||||||
|
design_service.clear_cache()
|
||||||
|
|
||||||
return {"status": "activated", "slug": slug}
|
return {"status": "activated", "slug": slug}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue