(imageUrl: string, path: string)
| 31 | return json; |
| 32 | }); |
| 33 | const uploadImage = (imageUrl: string, path: string) => |
| 34 | Effect.gen(function* () { |
| 35 | const res = yield* Effect.tryPromise(() => fetch(imageUrl)); |
| 36 | const blob = yield* Effect.tryPromise(() => res.blob()); |
| 37 | return yield* Effect.tryPromise(() => |
| 38 | put(path, blob, { access: "public" }), |
| 39 | ); |
| 40 | }); |
| 41 | |
| 42 | const main = Effect.gen(function* () { |
| 43 | const products = yield* Effect.tryPromise(() => |