fix: wire external dogs end-to-end (modal, form flag, pairing simulator) #49
Reference in New Issue
Block a user
Delete Branch "fix/external-dogs-wiring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this fixes
Three disconnected pieces of the external dogs feature were never actually wired together:
1.
ExternalDogs.jsx— broken navigation → modalnavigate('/dogs/new?external=1')which routed to the standard dog list, not an external dog form.showAddModal = true, opens<DogForm isExternal={true} />inline.fetchDogs()is called on save to refresh the list.2.
DogForm.jsx—isExternalprop never existedisExternalprop, nois_externalin state, and always sentis_externalas undefined in the POST/PUT payload.isExternalprop (defaultsfalse)effectiveExternal = isExternal || dog?.is_externalso editing an existing external dog also worksis_external: 1in submit payload when externalsire_id,dam_id,litter_idtonullin payload when external3.
PairingSimulator.jsx— only fetched kennel dogsfetch('/api/dogs')— external sires/dams never appeared in pairing selectors.fetch('/api/dogs?include_external=1')— external dogs included. Dropdown options show[Ext]suffix for easy identification.Backend requirement
The
/api/dogsendpoint needs to support?include_external=1to return both kennel and external dogs. If not already implemented, the default (no param) should continue returning kennel-only dogs.Test checklist
is_external=1in DB, litter/parent fields not sentis_externalpreserved[Ext]label