Skip to content

Commit

Permalink
add watched directory array items in response
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieVangeysel committed Dec 13, 2024
1 parent d0eb4af commit d45b27c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/controllers/profile.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export default async function (fastify: FastifyInstance) {
if (result.verified) {
if (result.error) return reply.error(result.error)

return reply.success({ dashboard: result.result })
return reply.success({
dashboard: result.result.recent_posts,
watched_directories: result.result.watched_directories,
watched_directories_posts: result.result.watched_directories_posts
})
}
return reply.error('Session has expired!', 401, performance.now() - start)
} catch (err) {
Expand Down
6 changes: 5 additions & 1 deletion src/repositories/profile.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export default class Profile {
return {
error,
verified,
result: result.recordsets[1] || []
result: {
recent_posts: result.recordsets[1] || [],
watched_directories: result.recordsets[2] || [],
watched_directories_posts: result.recordsets[3] || []
}
}
} else {
throw new Error(error)
Expand Down

0 comments on commit d45b27c

Please sign in to comment.