@@ -77,27 +77,24 @@ export async function createSession(c: HonoContext) {
7777 */
7878export async function getSessionDetails ( c : HonoContext ) {
7979 const server = c . get ( 'server' ) ;
80- const session = c . get ( 'session' ) ;
8180 const sessionId = c . req . query ( 'sessionId' ) ;
8281
8382 try {
84- if ( ! session ) {
85- return c . json ( { error : 'Session not found' } , 404 ) ;
83+ if ( ! sessionId ) {
84+ return c . json ( { error : 'SessionId not found' } , 404 ) ;
8685 }
8786
88- if ( sessionId ) {
89- const sessionInfo = await server . daoFactory . getSessionInfo ( sessionId ) ;
87+ const sessionInfo = await server . daoFactory . getSessionInfo ( sessionId ) ;
9088
91- sessionInfo && filterSessionModel ( [ sessionInfo ] ) ;
89+ sessionInfo && filterSessionModel ( [ sessionInfo ] ) ;
9290
93- if ( sessionInfo ) {
94- return c . json (
95- {
96- session : sessionInfo ,
97- } ,
98- 200 ,
99- ) ;
100- }
91+ if ( sessionInfo ) {
92+ return c . json (
93+ {
94+ session : sessionInfo ,
95+ } ,
96+ 200 ,
97+ ) ;
10198 }
10299
103100 return c . json ( { error : 'Session not found' } , 404 ) ;
@@ -163,7 +160,7 @@ export async function getSessionStatus(c: HonoContext) {
163160 return c . json ( { error : 'Session not found' } , 404 ) ;
164161 }
165162
166- const isProcessing = session . getProcessingStatus ( ) ;
163+ const isProcessing = session . getProcessingStatus ( ) ;
167164
168165 return c . json (
169166 {
@@ -186,7 +183,6 @@ export async function getSessionStatus(c: HonoContext) {
186183 */
187184export async function updateSession ( c : HonoContext ) {
188185 const server = c . get ( 'server' ) ;
189- const session = c . get ( 'session' ) ;
190186 const body = await c . req . json ( ) ;
191187
192188 const { sessionId, metadata : metadataUpdates } = body as {
@@ -195,8 +191,8 @@ export async function updateSession(c: HonoContext) {
195191 } ;
196192
197193 try {
198- if ( ! session ) {
199- return c . json ( { error : 'Session not found' } , 404 ) ;
194+ if ( ! sessionId ) {
195+ return c . json ( { error : 'SessionId not found' } , 404 ) ;
200196 }
201197
202198 const sessionInfo = await server . daoFactory . getSessionInfo ( sessionId ) ;
@@ -223,14 +219,12 @@ export async function updateSession(c: HonoContext) {
223219 */
224220export async function deleteSession ( c : HonoContext ) {
225221 const server = c . get ( 'server' ) ;
226- const session = c . get ( 'session' ) ;
222+ const sessionId = ( await c . req . json ( ) ) ?. sessionId
227223
228- if ( ! session ) {
229- return c . json ( { error : 'Session not found' } , 404 ) ;
224+ if ( ! sessionId ) {
225+ return c . json ( { error : 'sessionId not found' } , 404 ) ;
230226 }
231227
232- const sessionId = session . id ;
233-
234228 try {
235229 const sessionPool = server . getSessionPool ( ) ;
236230
0 commit comments