Skip to content

Commit

Permalink
feat(Trip): Fix trip call
Browse files Browse the repository at this point in the history
  • Loading branch information
Freezzzen committed Oct 15, 2024
1 parent cf25566 commit 755c9bf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/src/components/context/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type NavigationParamList = {
Publish: { initialValue?: Partial<ResolvedLianeRequest> };
SignUp: undefined;
Chat: { conversationId: string; liane?: Liane };
Communities: undefined;
Lianes: undefined;
CommunitiesChat: { group?: CoMatch; liane?: CoLiane; request?: CoLianeRequest | ResolvedLianeRequest; lianeId?: string };
LianeMapDetail: { group: CoMatch; request: ResolvedLianeRequest };
LianeTripDetail: { trip: Liane };
Expand Down
3 changes: 3 additions & 0 deletions app/src/screens/communities/CommunitiesChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export const CommunitiesChatScreen = () => {
[liane?.id]
);

// subscriptionTrip
// Invalidate cache

const fetchTrip = async (id: string) => {
try {
const tripsTemp = await services.community.getIncomingTrips(id);
Expand Down
2 changes: 1 addition & 1 deletion app/src/screens/communities/CommunitiesDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const CommunitiesDetailScreen = () => {
try {
const result = await services.community.leave(group.id);
AppLogger.debug("COMMUNITIES", "Lien quittée avec succès", result);
navigation.navigate("Communities");
navigation.navigate("Lianes");
} catch (e) {
AppLogger.debug("COMMUNITIES", "Au moment de quitter la liane, une erreur c'est produite", e);
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/screens/communities/LianeMapDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const LianeMapDetailScreen = () => {
try {
const result = await services.community.joinRequest(lianeRequest.id, group.liane);
AppLogger.debug("COMMUNITIES", "Demande de rejoindre une liane avec succès", result);
navigation.navigate("Communities");
navigation.navigate("Lianes");
} catch (error) {
AppLogger.debug("COMMUNITIES", "Une erreur est survenue lors de la demande de rejoindre d'une liane", error);
}
Expand All @@ -51,9 +51,9 @@ export const LianeMapDetailScreen = () => {
const acceptLiane = async () => {
if (lianeRequest && lianeRequest.id) {
try {
const result = await services.community.accept(lianeRequest.id, group.liane);
const result = await services.community.accept(group.liane, lianeRequest.id);
AppLogger.debug("COMMUNITIES", "Acceptation une liane avec succès", result);
navigation.navigate("Communities");
navigation.navigate("Lianes");
} catch (error) {
AppLogger.debug("COMMUNITIES", "Une erreur est survenue lors de l'acceptation d'une liane", error);
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/screens/publish/PublishScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const PublishScreen = () => {
...lianeRequest,
wayPoints: [trip.from!.id!, trip.to!.id!]
} as CoLianeRequest);
navigation.navigate("Communities");
navigation.navigate("Lianes");
} else {
await queryClient.invalidateQueries(LianeQueryKey);
const created = await services.community.create({
Expand All @@ -89,7 +89,7 @@ export const PublishScreen = () => {
if (shouldShow) {
showTutorial("driver", created.id);
} else {
navigation.navigate("Communities");
navigation.navigate("Lianes");
}
}
} finally {
Expand Down

0 comments on commit 755c9bf

Please sign in to comment.