feat(blog): add representation blog management features including listing, creating, and editing blogs
This commit is contained in:
@@ -87,6 +87,15 @@ class RepresentationBlogController extends BaseController
|
||||
return $this->paginated($items, $total, $page, $limit);
|
||||
}
|
||||
|
||||
#[OA\Get(path: '/api/v1/representation/blog/{uuid}', summary: "Get one of the representative's own posts", security: [['bearerAuth' => []]])]
|
||||
#[Route('/api/v1/representation/blog/{uuid}', methods: ['GET'])]
|
||||
public function detail(string $uuid, #[CurrentUser] User $user): JsonResponse
|
||||
{
|
||||
$rep = $this->currentRepresentation($user);
|
||||
$blog = $this->ownedBlogOr404($uuid, $rep);
|
||||
return $this->success(['data' => $blog->toArray()]);
|
||||
}
|
||||
|
||||
#[OA\Post(path: '/api/v1/representation/blog', summary: 'Create a post owned by the representative', security: [['bearerAuth' => []]])]
|
||||
#[Route('/api/v1/representation/blog', methods: ['POST'])]
|
||||
public function create(Request $request, #[CurrentUser] User $user): JsonResponse
|
||||
|
||||
Reference in New Issue
Block a user