added frontend unit addition/editing

This commit is contained in:
serversdwn
2025-12-02 07:53:16 +00:00
parent 90ecada35f
commit e46f668c34
2 changed files with 206 additions and 3 deletions

View File

@@ -24,8 +24,10 @@ def get_or_create_roster_unit(db: Session, unit_id: str):
def add_roster_unit(
id: str = Form(...),
unit_type: str = Form("series3"),
deployed: bool = Form(True),
deployed: bool = Form(False),
note: str = Form(""),
project_id: str = Form(None),
location: str = Form(None),
db: Session = Depends(get_db)
):
if db.query(RosterUnit).filter(RosterUnit.id == id).first():
@@ -36,6 +38,8 @@ def add_roster_unit(
unit_type=unit_type,
deployed=deployed,
note=note,
project_id=project_id,
location=location,
last_updated=datetime.utcnow(),
)
db.add(unit)