George S. Baugh 4 роки тому
батько
коміт
f541a77dda
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      lib/Trog/DataModule.pm

+ 6 - 0
lib/Trog/DataModule.pm

@@ -243,12 +243,18 @@ sub add ($self, @posts) {
         $post->{id} //= UUID::Tiny::create_uuid_as_string(UUID::Tiny::UUID_V1, UUID::Tiny::UUID_NS_DNS);
         $post->{aliases} //= [];
         $post->{aliases} = [$post->{aliases}] unless ref $post->{aliases} eq 'ARRAY';
+
         if ($post->{aclname}) {
             # Then this is a series
             $post->{local_href} //= "/$post->{aclname}";
             push(@{$post->{aliases}}, "/posts/$post->{id}", "/series/$post->{id}" );
         }
 
+        # If this is a user creation post, add in the /user/ route
+        if ($post->{callback} eq 'Trog::Routes::HTML::users') {
+            $post->{local_href} = "/users/$post->{user}";
+        }
+
         $post->{local_href} //= "/posts/$post->{id}";
         $post->{method}     //= 'GET';
         $post->{callback}   //= 'Trog::Routes::HTML::posts';