summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-11-28 01:43:33 +0100
committerSanto Cariotti <santo@dcariotti.me>2024-11-28 01:43:33 +0100
commitf5d17ffcb6d09e8f3498ad50952b688f3729901e (patch)
tree948ca61d65318229c605cc1d85b370ed7940f2e5
parent038be5daf65c3408304b3d7fbdb4c4003cfd1b6a (diff)
Remove `alertd` service
Revert of 5ee7d92
-rw-r--r--README.md2
-rw-r--r--app/(tabs)/index.tsx22
2 files changed, 16 insertions, 8 deletions
diff --git a/README.md b/README.md
index 7e2eaf1..b493088 100644
--- a/README.md
+++ b/README.md
@@ -18,8 +18,6 @@ After that you need to edit the `.env` file and set up:
- `EXPO_PUBLIC_API_URL`: refers to the backend URL.
-- `EXPO_PUBLIC_ALERTD_URL`: refers to the alertd URL.
-
And start the Expo app.
```
diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx
index 9fff8f8..f4ff0ea 100644
--- a/app/(tabs)/index.tsx
+++ b/app/(tabs)/index.tsx
@@ -348,18 +348,28 @@ export default function HomeScreen() {
}
const response = await fetch(
- `${process.env.EXPO_PUBLIC_ALERTD_URL}`,
+ `${process.env.EXPO_PUBLIC_API_URL}`,
{
method: "POST",
headers: {
+ Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
- latitude: coords.latitude,
- longitude: coords.longitude,
- login: token,
- uid: userId,
- movingActivity,
+ query: `
+ mutation NewPosition($input: PositionInput!) {
+ newPosition(input: $input) {
+ id userId createdAt latitude longitude movingActivity
+ }
+ }
+ `,
+ variables: {
+ input: {
+ latitude: coords.latitude,
+ longitude: coords.longitude,
+ movingActivity,
+ },
+ },
}),
},
);