summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-09-23 10:31:38 +0200
committerSanto Cariotti <santo@dcariotti.me>2024-09-23 10:31:38 +0200
commit5ee7d92337197ebb09ff802f9943e9692cb88f1e (patch)
treefd279434832fc469d8860639400b93538011f7db /app
parent23077b2d6fcbf3995e590ddf2ff3bc50f5b8d362 (diff)
Use alertd service
Diffstat (limited to 'app')
-rw-r--r--app/(tabs)/_layout.tsx6
-rw-r--r--app/(tabs)/alerts/[id].tsx8
-rw-r--r--app/(tabs)/index.tsx25
3 files changed, 10 insertions, 29 deletions
diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx
index e6852d9..71673d1 100644
--- a/app/(tabs)/_layout.tsx
+++ b/app/(tabs)/_layout.tsx
@@ -34,15 +34,15 @@ export default function TabLayout() {
/>
<Tabs.Screen
name="alerts/[id]"
- options={{href: null}}
+ options={{ href: null }}
/>
<Tabs.Screen
name="notifications/index"
- options={{href: null}}
+ options={{ href: null }}
/>
<Tabs.Screen
name="notifications/[id]"
- options={{href: null}}
+ options={{ href: null }}
/>
</Tabs>
);
diff --git a/app/(tabs)/alerts/[id].tsx b/app/(tabs)/alerts/[id].tsx
index 554c1ed..506d282 100644
--- a/app/(tabs)/alerts/[id].tsx
+++ b/app/(tabs)/alerts/[id].tsx
@@ -219,14 +219,6 @@ export default function AlertIdScreen() {
/>
<ThemedText>{formatDate(alert.createdAt)}</ThemedText>
</ThemedView>
- <ThemedView style={styles.dateRow}>
- <Ionicons
- name="alert-circle-outline"
- size={18}
- color={theme === 'light' ? Colors.light.text : Colors.dark.text}
- style={styles.icon}
- />
- </ThemedView>
</>
)}
</ParallaxScrollView>
diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx
index 4168c8f..6344a22 100644
--- a/app/(tabs)/index.tsx
+++ b/app/(tabs)/index.tsx
@@ -346,33 +346,22 @@ export default function HomeScreen() {
movingActivity = "IN_VEHICLE";
}
- const response = await fetch(
- `${process.env.EXPO_PUBLIC_API_URL}/graphql`,
+ await fetch(
+ `${process.env.EXPO_PUBLIC_ALERTD_URL}`,
{
method: "POST",
headers: {
- Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
- query: `
- mutation NewPosition($input: PositionInput!) {
- newPosition(input: $input) {
- id userId createdAt latitude longitude movingActivity
- }
- }
- `,
- variables: {
- input: {
- latitude: coords.latitude,
- longitude: coords.longitude,
- movingActivity,
- },
- },
+ latitude: coords.latitude,
+ longitude: coords.longitude,
+ login: token,
+ uid: userId,
+ movingActivity,
}),
},
);
- const data = await response.json();
} catch (err) {
console.error("Error on updating position");
}