feat: implement auto-sharing functionality for session creation across motivators, weekly check-ins, and year reviews, enhancing collaboration capabilities
This commit is contained in:
@@ -16,6 +16,16 @@ export async function createMotivatorSession(data: { title: string; participant:
|
||||
|
||||
try {
|
||||
const motivatorSession = await motivatorsService.createMotivatorSession(session.user.id, data);
|
||||
try {
|
||||
await motivatorsService.shareMotivatorSession(
|
||||
motivatorSession.id,
|
||||
session.user.id,
|
||||
data.participant,
|
||||
'EDITOR'
|
||||
);
|
||||
} catch (shareError) {
|
||||
console.error('Auto-share failed:', shareError);
|
||||
}
|
||||
revalidatePath('/motivators');
|
||||
return { success: true, data: motivatorSession };
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user