changing posts to reference clerkUserID rather than id in mongodb

This commit is contained in:
Will Baumbach
2025-08-06 23:24:43 -05:00
parent 482bc915a5
commit 0af55853f6
5 changed files with 7 additions and 5 deletions

View File

@@ -1,8 +1,10 @@
import { useUser } from '@clerk/clerk-react'
import { CameraView, useCameraPermissions } from 'expo-camera'
import React, { useRef, useState } from 'react'
import { Button, Image, Modal, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native'
export default function App() {
const { user } = useUser()
const [permission, requestPermission] = useCameraPermissions()
const [photo, setPhoto] = useState('')
const [address, setAddress] = useState('')
@@ -35,7 +37,7 @@ export default function App() {
'Content-Type': 'application/json'
},
body: JSON.stringify({
userID: '6883ddb2640ebaa1a12e3791',
clerkUserID: user?.id,
date: new Date(),
photo,
address,

View File

@@ -23,7 +23,7 @@ export default function PostsScreen() {
)
async function fetchData() {
fetch(`http://localhost:3000/api/v1/posts/user/6883ddb2640ebaa1a12e3791`)
fetch(`http://localhost:3000/api/v1/posts/user/${user?.id}`)
.then((res) => res.json())
.then((json) => {
console.log(json)