File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -264,13 +264,19 @@ export async function GET(event) {
264264 let results = < Media [ ] > ( < unknown > await prisma . media . findMany ( {
265265 where : {
266266 username : event . locals . user ?. username
267+ } ,
268+ orderBy : {
269+ created : "asc"
267270 }
268271 } ) ) ;
269272 return new Response ( JSON . stringify ( results ) ) ;
270273 } else if ( event . locals . role ?. canSeeAllMedia ) {
271274 let results = < Media [ ] > ( < unknown > await prisma . media . findMany ( {
272275 where : {
273276 username : requestedUsername
277+ } ,
278+ orderBy : {
279+ created : "asc"
274280 }
275281 } ) ) ;
276282 return new Response ( JSON . stringify ( results ) ) ;
@@ -286,6 +292,9 @@ export async function GET(event) {
286292 visibility : 2
287293 }
288294 ]
295+ } ,
296+ orderBy : {
297+ created : "asc"
289298 }
290299 } ) ;
291300 var results : { [ a : string ] : any } = { } ;
@@ -305,6 +314,9 @@ export async function GET(event) {
305314 where : {
306315 username : requestedUsername ,
307316 visibility : 2
317+ } ,
318+ orderBy : {
319+ created : "asc"
308320 }
309321 } ) ;
310322 var results : { [ a : string ] : any } = { } ;
@@ -336,6 +348,9 @@ export async function GET(event) {
336348 visibility : 2
337349 }
338350 ]
351+ } ,
352+ orderBy : {
353+ created : "asc"
339354 }
340355 } ) ;
341356 var results : { [ a : string ] : any } = { } ;
@@ -355,6 +370,9 @@ export async function GET(event) {
355370 where : {
356371 tripId : requestedTrip ,
357372 visibility : 2
373+ } ,
374+ orderBy : {
375+ created : "asc"
358376 }
359377 } ) ;
360378 var results : { [ a : string ] : any } = { } ;
You can’t perform that action at this time.
0 commit comments