refactor(data): add mock API adapters, id utility, and toast feedback
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { mockPosts } from "@/lib/mock"
|
||||
|
||||
export function listPosts() {
|
||||
return mockPosts
|
||||
}
|
||||
|
||||
export function getPostById(postId: string) {
|
||||
return mockPosts.find((post) => post.id === postId)
|
||||
}
|
||||
|
||||
export function listPostsByAuthor(userId: string) {
|
||||
return mockPosts.filter((post) => post.author.id === userId)
|
||||
}
|
||||
Reference in New Issue
Block a user