@@ -88,7 +88,7 @@ const app = new Hono()
88
88
const filteredWords = Object . fromEntries (
89
89
Object . entries ( data ) . filter ( ( [ , value ] ) => value . usage_category !== "sandbox" ) ,
90
90
) ;
91
- return c . json ( filteredWords ) ;
91
+ return c . json ( filteredWords , 200 ) ;
92
92
} )
93
93
94
94
. get (
@@ -101,7 +101,7 @@ const app = new Hono()
101
101
102
102
// FIXME: Remove when packaging script reworked
103
103
return word && word . usage_category !== "sandbox"
104
- ? c . json ( { ok : true as const , data : word } )
104
+ ? c . json ( { ok : true as const , data : word } , 200 )
105
105
: c . json (
106
106
{ ok : false as const , message : `Could not find the word ${ c . req . param ( "word" ) } ` } ,
107
107
400 ,
@@ -115,7 +115,7 @@ const app = new Hono()
115
115
const filteredWords = Object . fromEntries (
116
116
Object . entries ( data ) . filter ( ( [ , value ] ) => value . usage_category === "sandbox" ) ,
117
117
) ;
118
- return c . json ( filteredWords ) ;
118
+ return c . json ( filteredWords , 200 ) ;
119
119
120
120
// return c.json((await rawData).sandbox);
121
121
} )
@@ -129,7 +129,7 @@ const app = new Hono()
129
129
const word = ( await rawData ) . words [ c . req . param ( "word" ) ] ;
130
130
// FIXME: Remove when packaging script reworked
131
131
return word && word . usage_category === "sandbox"
132
- ? c . json ( { ok : true as const , data : word } )
132
+ ? c . json ( { ok : true as const , data : word } , 200 )
133
133
: c . json (
134
134
{
135
135
ok : false as const ,
@@ -141,7 +141,7 @@ const app = new Hono()
141
141
)
142
142
143
143
. get ( "/luka_pona/fingerspelling" , langValidator , languagesFilter ( true ) , async ( c ) => {
144
- return c . json ( ( await rawData ) . fingerspelling ) ;
144
+ return c . json ( ( await rawData ) . fingerspelling , 200 ) ;
145
145
} )
146
146
147
147
. get (
@@ -153,13 +153,13 @@ const app = new Hono()
153
153
const sign = ( await rawData ) . fingerspelling [ c . req . param ( "sign" ) ] ;
154
154
155
155
return sign
156
- ? c . json ( { ok : true as const , data : sign } )
156
+ ? c . json ( { ok : true as const , data : sign } , 200 )
157
157
: c . json ( { ok : false as const , message : `Could not find a sign named ${ sign } ` } , 400 ) ;
158
158
} ,
159
159
)
160
160
161
161
. get ( "/luka_pona/signs" , langValidator , languagesFilter ( true ) , async ( c ) => {
162
- return c . json ( ( await rawData ) . signs ) ;
162
+ return c . json ( ( await rawData ) . signs , 200 ) ;
163
163
} )
164
164
165
165
. get (
@@ -171,25 +171,25 @@ const app = new Hono()
171
171
const sign = ( await rawData ) . signs [ c . req . param ( "sign" ) ] ;
172
172
173
173
return sign
174
- ? c . json ( { ok : true as const , data : sign } )
174
+ ? c . json ( { ok : true as const , data : sign } , 200 )
175
175
: c . json ( { ok : false as const , message : `Could not find a sign named ${ sign } ` } , 400 ) ;
176
176
} ,
177
177
)
178
178
179
179
. get ( "/fonts" , async ( c ) => {
180
- return c . json ( ( await rawData ) . fonts ) ;
180
+ return c . json ( ( await rawData ) . fonts , 200 ) ;
181
181
} )
182
182
183
183
. get ( "/fonts/:font" , zValidator ( "param" , z . object ( { font : z . string ( ) } ) ) , async ( c ) => {
184
184
const font = ( await rawData ) . fonts [ c . req . param ( "font" ) ] ;
185
185
186
186
return font
187
- ? c . json ( { ok : true as const , data : font } )
187
+ ? c . json ( { ok : true as const , data : font } , 200 )
188
188
: c . json ( { ok : false as const , message : `Could not find a font named ${ font } ` } , 400 ) ;
189
189
} )
190
190
191
191
. get ( "/languages" , async ( c ) => {
192
- return c . json ( ( await rawData ) . languages ) ;
192
+ return c . json ( ( await rawData ) . languages , 200 ) ;
193
193
} )
194
194
195
195
. get (
@@ -201,7 +201,7 @@ const app = new Hono()
201
201
const langId = langIdCoalesce ( language , languages ) ;
202
202
203
203
return langId
204
- ? c . json ( { ok : true as const , data : languages [ langId ] ! } )
204
+ ? c . json ( { ok : true as const , data : languages [ langId ] ! } , 200 )
205
205
: c . json (
206
206
{ ok : false as const , message : `Could not find a language named ${ language } ` } ,
207
207
400 ,
0 commit comments