File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
client/my-app/src/components/features/settings Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -66,18 +66,18 @@ export default function DefaultEvent() {
6666 try {
6767 setLoading ( true ) ;
6868
69- // ⭐ 1) เรียก Event API
69+
7070 const eventRes = await fetch ( EVENT_API ) ;
7171 const eventJson = await eventRes . json ( ) ;
7272
7373 if ( ! eventRes . ok ) {
7474 throw new Error ( "โหลดข้อมูล Event ไม่สำเร็จ" ) ;
7575 }
7676
77- // backend ส่ง { message, data: [...] }
77+
7878 const events : Event [ ] = eventJson . data ;
7979
80- // ⭐ 2) เรียก API กล้องทีละ event
80+
8181 const merged : RowData [ ] = await Promise . all (
8282 events . map ( async ( ev ) => {
8383 try {
@@ -125,7 +125,7 @@ export default function DefaultEvent() {
125125 } ) ;
126126 } catch ( err ) {
127127 console . error ( "Update failed" , err ) ;
128- // ถ้าจะ rollback ต้องเก็บ state เก่าไว้ หรือ refetch ใหม่
128+
129129 }
130130 } ;
131131
You can’t perform that action at this time.
0 commit comments