analytica-frontend-lib 1.4.15 → 1.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -25322,6 +25322,7 @@ var RecommendedLessonCreate = ({
25322
25322
  activityDraftId: id,
25323
25323
  sequence: index + 1
25324
25324
  })) : void 0;
25325
+ const hasAttachedActivities = !!activityDraftIds && activityDraftIds.length > 0;
25325
25326
  const lessonPayload = {
25326
25327
  title: formData.title || recommendedLesson?.title || "Aula Recomendada",
25327
25328
  subjectId: subjectId || null,
@@ -25334,7 +25335,12 @@ var RecommendedLessonCreate = ({
25334
25335
  finalDate: finalDateTime,
25335
25336
  targetStudentIds: formData.students.map((s) => s.userInstitutionId),
25336
25337
  // Send notification as separate field (backend expects "notification")
25337
- ...formData.notification && { notification: formData.notification }
25338
+ ...formData.notification && { notification: formData.notification },
25339
+ // Forward retry flag only when activities are actually attached
25340
+ // — backend ignores it otherwise and it would just be noise.
25341
+ ...hasAttachedActivities && {
25342
+ canRetry: formData.canRetry ?? false
25343
+ }
25338
25344
  };
25339
25345
  const createResponse = await apiClient.post(
25340
25346
  "/recommended-class",
@@ -25551,6 +25557,7 @@ var RecommendedLessonCreate = ({
25551
25557
  categories,
25552
25558
  onCategoriesChange: handleCategoriesChange,
25553
25559
  isLoading: isSendingLesson,
25560
+ hasAttachedActivities: (recommendedLesson?.activityDraftIds?.length ?? 0) > 0,
25554
25561
  onError: (error) => {
25555
25562
  console.error("Error sending lesson:", error);
25556
25563
  const errorMessage = error instanceof Error ? error.message : "Erro ao enviar aula. Por favor, tente novamente.";