/**
 * Returns sorting query for past/upcoming launches
*/

const lowerCase = require("lower-case")

exports.launchSort = (req) => {
  const query = {}

  if (lowerCase(req.query.order) === "asc") {
    query.flight_number = 1
  } else if (lowerCase(req.query.order) === "desc") {
    query.flight_number = -1
  } else {
    query.flight_number = 1
  }

  return query
}

@@ -79,17 +79,17 @@
 require(
-%22
+'
 lower-ca
@@ -90,18 +90,19 @@
 wer-case
-%22)
+');
 %0A%0Aexport
@@ -145,16 +145,17 @@
 ery = %7B%7D
+;
 %0A%0A  if (
@@ -189,13 +189,13 @@
 === 
-%22asc%22
+'asc'
 ) %7B%0A
@@ -217,24 +217,25 @@
 t_number = 1
+;
 %0A  %7D else if
@@ -271,14 +271,14 @@
 === 
-%22
+'
 desc
-%22
+'
 ) %7B%0A
@@ -305,16 +305,17 @@
 ber = -1
+;
 %0A  %7D els
@@ -345,16 +345,17 @@
 mber = 1
+;
 %0A  %7D%0A%0A  
@@ -370,7 +370,9 @@
 uery
+;
 %0A%7D
+;
 %0A

format launch sort with airbnb style