Feature: Kontaktformular-Modal ersetzt mailto-Links, speichert in PocketBase inquiries
This commit is contained in:
parent
cfdb52643f
commit
829a4b6e0e
2 changed files with 176 additions and 6 deletions
36
scripts/setup-inquiries.sh
Executable file
36
scripts/setup-inquiries.sh
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
# Legt die inquiries-Collection für Kontaktanfragen an
|
||||
|
||||
set -euo pipefail
|
||||
PB_URL="${PB_URL:-https://api.checkflo.de}"
|
||||
|
||||
if [ -z "${PB_EMAIL:-}" ] || [ -z "${PB_PASSWORD:-}" ]; then
|
||||
echo "Aufruf: PB_EMAIL=... PB_PASSWORD=... ./setup-inquiries.sh"; exit 1
|
||||
fi
|
||||
|
||||
TOKEN=$(curl -sf -X POST "$PB_URL/api/collections/_superusers/auth-with-password" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"identity\":\"$PB_EMAIL\",\"password\":\"$PB_PASSWORD\"}" | jq -r '.token')
|
||||
|
||||
curl -sf -X POST "$PB_URL/api/collections" \
|
||||
-H "Authorization: $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"name": "inquiries",
|
||||
"type": "base",
|
||||
"fields": [
|
||||
{"name": "name", "type": "text", "required": true},
|
||||
{"name": "company", "type": "text"},
|
||||
{"name": "email", "type": "email", "required": true},
|
||||
{"name": "phone", "type": "text"},
|
||||
{"name": "message", "type": "text"},
|
||||
{"name": "plan", "type": "text"}
|
||||
],
|
||||
"listRule": null,
|
||||
"viewRule": null,
|
||||
"createRule": "",
|
||||
"updateRule": null,
|
||||
"deleteRule": null
|
||||
}' | jq .name
|
||||
|
||||
echo "✓ inquiries Collection angelegt"
|
||||
Loading…
Add table
Add a link
Reference in a new issue