SuperAPI AI Directory

d2-04-form-page

General & other

View repository

Updated 10-16 05:44

About this skill

Day 2 · Step 4 — Form page, then redeploy

up-app/src/app/pages/<entity>-form/<entity>-form.component.ts:

  • Reads id from the route (ActivatedRoute). No id → create mode (empty form). id present → edit mode (call getById(id) to prefill).
  • Cancel button → router.navigate(['/<entity>']) without saving.
  • Save button → create mode calls save(), edit mode calls update(id, ...); on success (the subscribe's next callback), router.navigate(['/<entity>']).

Redeploy from the project root:

docker compose up -d --build

Verify: Add → fill form → Save → back on search with the new row. Edit that row → change a field → Save → row updated.