待测试
This commit is contained in:
+16
-16
@@ -401,18 +401,14 @@ export const findTreeMemberPresentationFixture = (genealogyId, personId) => {
|
||||
// mock API 只能通过下方 list/find 查询取得深拷贝,不能把页面草稿写回正式列表。
|
||||
const familyFeeds = [
|
||||
{
|
||||
id: '1', genealogyId: '1001', tag: '团圆记忆', time: '今天 10:24',
|
||||
title: '端午家宴', content: '今年端午全家相聚,长辈讲起祖居旧事,孩子们也为大家拍下了新的全家福。饭后我们把照片和口述片段整理进家族档案,让这份热闹成为往后仍能翻看的共同记忆。',
|
||||
author: '汤正国',
|
||||
comments: [
|
||||
{ id: '1', author: '汤淑华', time: '今天 10:42', content: '一家人能常常相聚,就是最珍贵的福气。' },
|
||||
{ id: '2', author: '汤文清', time: '今天 11:08', content: '照片已经整理好了,晚些时候放进春节团圆相册。' }
|
||||
]
|
||||
feedId: '1', genealogyId: '1001', feedType: '团圆记忆', createTime: '今天 10:24',
|
||||
feedContent: '今年端午全家相聚,长辈讲起祖居旧事,孩子们也为大家拍下了新的全家福。饭后我们把照片和口述片段整理进家族档案,让这份热闹成为往后仍能翻看的共同记忆。',
|
||||
publisherNickName: '汤正国', mediaOssIds: '', likedByMe: false, likeCount: 0, commentCount: 2, pinned: '0'
|
||||
},
|
||||
{
|
||||
id: '2', genealogyId: '1001', tag: '家族通知', time: '昨天 18:02',
|
||||
title: '修谱资料征集', content: '请家人补充老照片中的人物姓名、拍摄时间和地点。无法确认的信息也可以先写下线索,由熟悉往事的长辈共同核对。',
|
||||
author: '谱主', comments: []
|
||||
feedId: '2', genealogyId: '1001', feedType: '家族通知', createTime: '昨天 18:02',
|
||||
feedContent: '请家人补充老照片中的人物姓名、拍摄时间和地点。无法确认的信息也可以先写下线索,由熟悉往事的长辈共同核对。',
|
||||
publisherNickName: '谱主', mediaOssIds: '', likedByMe: false, likeCount: 0, commentCount: 0, pinned: '0'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -476,10 +472,7 @@ const familyAlbums = [
|
||||
}
|
||||
]
|
||||
|
||||
const cloneFamilyFeedFixture = (feed) => ({
|
||||
...feed,
|
||||
comments: feed.comments.map((comment) => ({ ...comment }))
|
||||
})
|
||||
const cloneFamilyFeedFixture = (feed) => ({ ...feed })
|
||||
const cloneFamilyArticleFixture = (article) => ({
|
||||
...article,
|
||||
paragraphs: [...article.paragraphs]
|
||||
@@ -510,8 +503,15 @@ const findScopedFamilyFixture = (items, clone, genealogyId, entityId) => {
|
||||
|
||||
export const listFamilyFeedFixtures = (genealogyId) =>
|
||||
listScopedFamilyFixtures(familyFeeds, cloneFamilyFeedFixture, genealogyId)
|
||||
export const findFamilyFeedFixture = (genealogyId, feedId) =>
|
||||
findScopedFamilyFixture(familyFeeds, cloneFamilyFeedFixture, genealogyId, feedId)
|
||||
export const findFamilyFeedFixture = (genealogyId, feedId) => {
|
||||
const normalizedGenealogyId = String(genealogyId || '')
|
||||
const normalizedFeedId = String(feedId || '')
|
||||
if (!normalizedGenealogyId || !normalizedFeedId) return null
|
||||
const feed = familyFeeds.find(
|
||||
(candidate) => candidate.genealogyId === normalizedGenealogyId && candidate.feedId === normalizedFeedId
|
||||
)
|
||||
return feed ? cloneFamilyFeedFixture(feed) : null
|
||||
}
|
||||
export const listFamilyArticleFixtures = (genealogyId) =>
|
||||
listScopedFamilyFixtures(familyArticles, cloneFamilyArticleFixture, genealogyId)
|
||||
export const findFamilyArticleFixture = (genealogyId, articleId) =>
|
||||
|
||||
Reference in New Issue
Block a user