MCPcopy Index your code
hub / github.com/AnswerOverflow/AnswerOverflow / createChannel

Function createChannel

packages/core/src/channel.ts:220–231  ·  view source on GitHub ↗
(data: z.infer<typeof zChannelCreate>)

Source from the content-addressed store, hash-verified

218}
219
220export async function createChannel(data: z.infer<typeof zChannelCreate>) {
221 const combinedData = applyChannelSettingsChangesSideEffects({
222 old: getDefaultChannelWithFlags(data),
223 updated: data,
224 });
225 await db.insert(dbChannels).values(combinedData);
226 const created = await db.query.dbChannels.findFirst({
227 where: eq(dbChannels.id, combinedData.id),
228 });
229 if (!created) throw new Error('Error creating channel');
230 return addFlagsToChannel(created);
231}
232
233export async function createManyChannels(
234 data: z.infer<typeof zChannelCreateMany>[],

Callers 7

message.test.tsFile · 0.90
channel.test.tsFile · 0.90
createManyChannelsFunction · 0.85
createChannelWithDepsFunction · 0.85
upsertChannelFunction · 0.85

Calls 3

addFlagsToChannelFunction · 0.90

Tested by

no test coverage detected