Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0aa633a483 | |||
| 8404bcafd0 | |||
| e3529f892c |
@@ -91,3 +91,4 @@ frontend/expo-env.d.ts
|
|||||||
|
|
||||||
|
|
||||||
CLAUDE.md
|
CLAUDE.md
|
||||||
|
ksan.dev.keystore
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package dev.ksan.etfoglasiserver.config;
|
|||||||
|
|
||||||
import dev.ksan.etfoglasiserver.service.JWTService;
|
import dev.ksan.etfoglasiserver.service.JWTService;
|
||||||
import dev.ksan.etfoglasiserver.service.MyUserDetailsService;
|
import dev.ksan.etfoglasiserver.service.MyUserDetailsService;
|
||||||
import dev.ksan.etfoglasiserver.service.UserService;
|
|
||||||
import io.jsonwebtoken.JwtException;
|
import io.jsonwebtoken.JwtException;
|
||||||
import jakarta.servlet.FilterChain;
|
import jakarta.servlet.FilterChain;
|
||||||
import jakarta.servlet.ServletException;
|
import jakarta.servlet.ServletException;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class EntryController {
|
|||||||
return service.getEntryById(entryId);
|
return service.getEntryById(entryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
//ignore this for now
|
// TODO only for testing
|
||||||
@PostMapping("/entries")
|
@PostMapping("/entries")
|
||||||
public void addEntry(@RequestBody EntryDTO entry) {
|
public void addEntry(@RequestBody EntryDTO entry) {
|
||||||
service.addEntry(entry);
|
service.addEntry(entry);
|
||||||
@@ -62,13 +62,14 @@ public class EntryController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PutMapping("/entries")
|
// @PutMapping("/entries")
|
||||||
public void updateEntry(@RequestBody EntryDTO entry) {
|
// public void updateEntry(@RequestBody EntryDTO entry) {
|
||||||
service.updateEntry(entry);
|
// service.updateEntry(entry);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@DeleteMapping("/entries/{entryId}")
|
// @DeleteMapping("/entries/{entryId}")
|
||||||
public void deleteEntry(@PathVariable String entryId) {
|
// public void deleteEntry(@PathVariable String entryId) {
|
||||||
service.deleteEntry(entryId);
|
// service.deleteEntry(entryId);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,14 +139,15 @@ class EntryControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
//we removed this from controller so test is pointless
|
||||||
@WithMockUser
|
// @Test
|
||||||
void deleteEntry_authenticated_returns200() throws Exception {
|
// @WithMockUser
|
||||||
doNothing().when(entryService).deleteEntry("entry-1");
|
// void deleteEntry_authenticated_returns200() throws Exception {
|
||||||
|
// doNothing().when(entryService).deleteEntry("entry-1");
|
||||||
mvc.perform(delete("/api/entries/entry-1"))
|
//
|
||||||
.andExpect(status().isOk());
|
// mvc.perform(delete("/api/entries/entry-1"))
|
||||||
}
|
// .andExpect(status().isOk());
|
||||||
|
// }
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void deleteEntry_unauthenticated_returns401or403() throws Exception {
|
void deleteEntry_unauthenticated_returns401or403() throws Exception {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../globals.css";
|
import "../globals.css";
|
||||||
import { useEffect } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Stack } from 'expo-router';
|
import { Stack } from 'expo-router';
|
||||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||||
import {
|
import {
|
||||||
@@ -11,6 +11,8 @@ import {
|
|||||||
} from '@react-native-firebase/messaging';
|
} from '@react-native-firebase/messaging';
|
||||||
import { registerDeviceToken, listenForTokenRefresh, displayLocalNotification } from '@/services/notifications';
|
import { registerDeviceToken, listenForTokenRefresh, displayLocalNotification } from '@/services/notifications';
|
||||||
import { AuthProvider, useAuth } from "@/context/AuthContext";
|
import { AuthProvider, useAuth } from "@/context/AuthContext";
|
||||||
|
import { useUpdatecheck } from '@/hooks/useUpdatecheck';
|
||||||
|
import { UpdatePrompt } from '@/components/UpdatePrompt';
|
||||||
import Toast from 'react-native-toast-message';
|
import Toast from 'react-native-toast-message';
|
||||||
|
|
||||||
// Registered at module scope so it's installed as soon as this entry file
|
// Registered at module scope so it's installed as soon as this entry file
|
||||||
@@ -60,12 +62,22 @@ function NotificationSetup() {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function UpdateCheck() {
|
||||||
|
const { updateInfo } = useUpdatecheck();
|
||||||
|
const [dismissed, setDismissed] = useState(false);
|
||||||
|
|
||||||
|
if (!updateInfo || dismissed) return null;
|
||||||
|
|
||||||
|
return <UpdatePrompt updateInfo={updateInfo} onDismiss={() => setDismissed(true)} />;
|
||||||
|
}
|
||||||
|
|
||||||
export default function RootLayout() {
|
export default function RootLayout() {
|
||||||
return (
|
return (
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<SafeAreaProvider>
|
<SafeAreaProvider>
|
||||||
<NotificationSetup />
|
<NotificationSetup />
|
||||||
<Stack screenOptions={{ headerShown: false }} />
|
<Stack screenOptions={{ headerShown: false }} />
|
||||||
|
<UpdateCheck />
|
||||||
<Toast />
|
<Toast />
|
||||||
</SafeAreaProvider>
|
</SafeAreaProvider>
|
||||||
</AuthProvider>
|
</AuthProvider>
|
||||||
|
|||||||
Reference in New Issue
Block a user