@@ -9,21 +9,21 @@ import {PromptMessagesProps} from '@/src/interfaces/prompt';
9
9
import icons from '@/public/svgs/prompt' ;
10
10
import '@/src/styles/variable.css' ;
11
11
12
- const PromptChat = ( ) => {
12
+ const PromptChat = ( { pId } : { pId : number } ) => {
13
13
const [ messages , setMsg ] = useState < PromptMessagesProps [ ] > ( ) ;
14
14
const [ inputMsg , setInputMsg ] = useState < string > ( '' ) ;
15
15
const [ promptRes , setPromptRes ] = useState < string > ( '' ) ;
16
16
const [ reload , setReload ] = useState < boolean > ( false ) ;
17
17
18
18
useEffect ( ( ) => {
19
- getPrompt ( 4 , 126 , 1 , 6 ) . then ( res => {
19
+ getPrompt ( 4 , pId , 1 , 6 ) . then ( res => {
20
20
res . messages . reverse ( ) ;
21
21
setMsg ( res . messages ) ;
22
22
} ) ;
23
23
} , [ reload ] ) ;
24
24
25
25
const handleClickIcon = ( mId : number ) => {
26
- patchMessage ( 4 , 126 , mId , true ) . then ( res => {
26
+ patchMessage ( 4 , pId , mId , true ) . then ( res => {
27
27
console . log ( res ) ;
28
28
} ) ;
29
29
} ;
@@ -56,7 +56,7 @@ const PromptChat = () => {
56
56
57
57
useEffect ( ( ) => {
58
58
if ( inputMsg === '' ) return ;
59
- postPrompt ( 4 , 126 , inputMsg , chat ) . then ( ( ) => {
59
+ postPrompt ( 4 , pId , inputMsg , chat ) . then ( ( ) => {
60
60
setInputMsg ( '' ) ;
61
61
} ) ;
62
62
} , [ inputMsg ] ) ;
0 commit comments