Răsfoiți Sursa

finish san of JSON routes

George Baugh 1 an în urmă
părinte
comite
38dc796f76
2 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 1 0
      lib/TCMS.pm
  2. 3 3
      lib/Trog/Routes/JSON.pm

+ 1 - 0
lib/TCMS.pm

@@ -189,6 +189,7 @@ sub _app {
     if ( !exists $routes{$path} ) {
         my @captures;
 
+		# XXX maybe this should all just go into $query?
         # TODO can optimize by having separate hashes for capture/non-capture routes
         foreach my $pattern ( keys(%routes) ) {
             @captures = $path =~ m/^$pattern$/;

+ 3 - 3
lib/Trog/Routes/JSON.pm

@@ -28,17 +28,17 @@ our %routes = (
     '/api/catalog' => {
         method     => 'GET',
         callback   => \&catalog,
-        parameters => [],
+        parameters => {},
     },
     '/api/webmanifest' => {
         method     => 'GET',
         callback   => \&webmanifest,
-        parameters => [],
+        parameters => {},
     },
     '/api/version' => {
         method     => 'GET',
         callback   => \&version,
-        parameters => [],
+        parameters => {},
     },
     '/api/auth_change_request/(.*)' => {
         method     => 'GET',