(keys: {
organizationIconUrl: ImageUpload.ImageUrlOrKey | null;
collectionLogoUrl: ImageUpload.ImageUrlOrKey | null;
})
| 198 | } |
| 199 | |
| 200 | async function resolveIconUrls(keys: { |
| 201 | organizationIconUrl: ImageUpload.ImageUrlOrKey | null; |
| 202 | collectionLogoUrl: ImageUpload.ImageUrlOrKey | null; |
| 203 | }): Promise<{ |
| 204 | organizationIconUrl: ImageUpload.ImageUrl | null; |
| 205 | collectionLogoUrl: ImageUpload.ImageUrl | null; |
| 206 | }> { |
| 207 | const empty = { |
| 208 | organizationIconUrl: null, |
| 209 | collectionLogoUrl: null, |
| 210 | }; |
| 211 | |
| 212 | if (!keys.organizationIconUrl && !keys.collectionLogoUrl) { |
| 213 | return empty; |
| 214 | } |
| 215 | |
| 216 | return Effect.gen(function* () { |
| 217 | const imageUploads = yield* ImageUploads; |
| 218 | const resolve = (key: ImageUpload.ImageUrlOrKey | null) => |
| 219 | key ? imageUploads.resolveImageUrl(key) : Effect.succeed(null); |
| 220 | |
| 221 | return { |
| 222 | organizationIconUrl: yield* resolve(keys.organizationIconUrl), |
| 223 | collectionLogoUrl: yield* resolve(keys.collectionLogoUrl), |
| 224 | }; |
| 225 | }).pipe(runPromise); |
| 226 | } |
| 227 | |
| 228 | function collectionLogoKey( |
| 229 | publicPage: Required<PublicCollectionDomain.PublicPageSettings>, |
no test coverage detected