Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Backend/routes/appointments.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ def add_appointment():
if not all([title, content, appointment_date, appointment_time, appointment_location]):
return jsonify({"error": "Missing required fields"}), 400

db.execute(
cursor = db.cursor()
cursor.execute(
'INSERT INTO appointments (title, content, appointment_date, appointment_time, appointment_location, appointment_status) VALUES (?, ?, ?, ?, ?, ?)',
(title, content, appointment_date, appointment_time, appointment_location, 'pending')
)
db.commit()

new_id = cursor.lastrowid

return jsonify({"status": "success", "message": "Appointment added successfully"}), 200
return jsonify({"status": "success", "message": "Appointment added successfully", "id": new_id}), 200

except sqlite3.OperationalError:
return jsonify({"error": "Database Error"}), 500
Expand Down
16 changes: 14 additions & 2 deletions Frontend/App.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
import React from 'react';
import React, { useEffect } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { Provider as PaperProvider} from 'react-native-paper';
import { ThemeProvider } from './src/theme/ThemeContext';
import { AgentProvider } from './src/context/AgentContext';
import StackNavigation from './src/navigation/StackNavigator';
import NotificationService from './src/services/NotificationService';

export default function App() {

useEffect(() => {
const initNotifications = async () => {
try {
await NotificationService.init();
} catch (error) {
console.error('App Failed to initialize notifications:', error);
}
};
initNotifications();
}, []);

export default function App() {
return (
<PaperProvider>
<ThemeProvider>
Expand Down
4 changes: 3 additions & 1 deletion Frontend/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
Expand Down
1 change: 1 addition & 0 deletions Frontend/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
android.enableJetifier=true

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
Expand Down
Loading