Skip to content

Commit

Permalink
Add default avatar picture to team engagement records
Browse files Browse the repository at this point in the history
  • Loading branch information
zoul committed Oct 28, 2024
1 parent d401b36 commit a81b2b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/data/team-engagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import {
import {
decodeValidItemsFromArray,
optionalArray,
relationToZeroOrOne,
takeFirst,
withDefault,
} from "~/src/decoding";
import { defaultAvatarUrl } from "~/src/utils";

import { appBase, unwrapRecords } from "./airtable";

Expand All @@ -36,7 +38,10 @@ export const decodeTeamEngagement = record({
projectId: field("project", relationToOne),
userId: relationToOne,
userName: relationToOne,
userAvatarUrl: relationToOne,
userAvatarUrl: field(
"userAvatarUrl",
withDefault(relationToZeroOrOne, defaultAvatarUrl),
),
projectRole: optional(string),
projectName: relationToOne,
projectSlug: relationToOne,
Expand Down
1 change: 0 additions & 1 deletion src/data/user-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { type FieldSet } from "airtable";
import {
array,
field,
number,
optional,
record,
string,
Expand Down

0 comments on commit a81b2b8

Please sign in to comment.