Files
shopdb-flask/shopdb/plugins/templates/frontend/frontend-api-snippet.js.tmpl
Cam Proudlock a9d0dfff4a Initial import: shopdb-flask multi-site asset platform
Flask + Vue rewrite of the classic-ASP shopdb, built as a plugin
framework so sister GE Aerospace sites can adopt it. Product version
0.7.0-pre-0.8.0, plugin contract 0.11.0, 966 backend tests.

Key entry points:
- docs/INSTALL-WINDOWS-IIS.md - tested Windows + IIS install runbook
  (own-site and subpath deployment methods)
- docs/PILOT-DEPLOY.md - production pilot: stand up + import + verify
- docs/IMPORT-API.md - schema-agnostic legacy data import contract
- scripts/site_imports/wjf/ - West Jefferson reference import loader
- docs/adr/ - twelve accepted architecture decision records
2026-07-14 07:58:51 -04:00

36 lines
1.1 KiB
Cheetah

/*
* ${Name} API client snippet.
*
* Paste this ${name}Api block into frontend/src/api/index.js (next to the
* other per-resource blocks). Then, in the generated ${Name}List, ${Name}Detail,
* and ${Name}Form views, delete the local ${name}Api const and import the shared
* one instead:
*
* import { ${name}Api } from '../../api'
*
* The scaffolded views ship with an identical inline client so they build and
* run before you touch the shared api module. This file is NOT auto-merged into
* api/index.js on purpose; that module is hand-maintained and shared.
*
* The create/update/delete calls assume matching POST/PUT/DELETE routes exist
* on the backend. The scaffolded api/routes.py only ships list and get; add the
* write endpoints when you wire up the form.
*/
export const ${name}Api = {
list(params = {}) {
return api.get('/${name}', { params })
},
get(itemId) {
return api.get(`/${name}/${itemId}`)
},
create(data) {
return api.post('/${name}', data)
},
update(itemId, data) {
return api.put(`/${name}/${itemId}`, data)
},
remove(itemId) {
return api.delete(`/${name}/${itemId}`)
}
}