feat(blog): add representation blog management features including listing, creating, and editing blogs

This commit is contained in:
hamed
2026-07-23 22:13:37 +03:30
parent 62b2f28c4f
commit dab36058a3
9 changed files with 485 additions and 86 deletions
@@ -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