Process incoming story messages
This commit is contained in:
parent
df7cdfacc7
commit
eb91eb6fec
84 changed files with 4382 additions and 652 deletions
|
@ -281,6 +281,7 @@ const dataInterface: ServerInterface = {
|
|||
_deleteAllStoryDistributions,
|
||||
createNewStoryDistribution,
|
||||
getAllStoryDistributionsWithMembers,
|
||||
getStoryDistributionWithMembers,
|
||||
modifyStoryDistribution,
|
||||
modifyStoryDistributionMembers,
|
||||
deleteStoryDistribution,
|
||||
|
@ -3965,6 +3966,33 @@ async function getAllStoryDistributionsWithMembers(): Promise<
|
|||
members: (byListId[list.id] || []).map(member => member.uuid),
|
||||
}));
|
||||
}
|
||||
async function getStoryDistributionWithMembers(
|
||||
id: string
|
||||
): Promise<StoryDistributionWithMembersType | undefined> {
|
||||
const db = getInstance();
|
||||
const storyDistribution = prepare(
|
||||
db,
|
||||
'SELECT * FROM storyDistributions WHERE id = $id;'
|
||||
).get({
|
||||
id,
|
||||
});
|
||||
|
||||
if (!storyDistribution) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const members = prepare(
|
||||
db,
|
||||
'SELECT * FROM storyDistributionMembers WHERE listId = $id;'
|
||||
).all({
|
||||
id,
|
||||
});
|
||||
|
||||
return {
|
||||
...storyDistribution,
|
||||
members: members.map(({ uuid }) => uuid),
|
||||
};
|
||||
}
|
||||
async function modifyStoryDistribution(
|
||||
distribution: StoryDistributionType
|
||||
): Promise<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue