All files / utils courseEmailsUtils.js

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18              1393x           6x        
/**
 * Query key prefix for every cached result of GET /api/courses/emails for a
 * course (whatever the type and format). Mutations that change who is on the
 * staff list or roster invalidate this prefix so that any Emails card showing
 * those addresses refetches them.
 */
export function courseEmailsQueryKey(courseId) {
  return `/api/courses/emails?courseId=${courseId}`;
}
 
// The formats GET /api/courses/emails can return the addresses in: `value` is
// the EmailFormats value the endpoint accepts, `label` is what the user sees.
// The first one is the default.
export const EMAIL_FORMATS = [
  { value: "ONE_PER_LINE", label: "One per line" },
  { value: "COMMA_SEPARATED", label: "Comma separated" },
];