mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 07:44:54 -06:00
26 lines
500 B
JavaScript
26 lines
500 B
JavaScript
import { Record, OrderedSet } from 'immutable';
|
|
|
|
export type ImageRaw = {
|
|
url: string,
|
|
username: string,
|
|
date: number,
|
|
food_item_id: string,
|
|
};
|
|
|
|
const ImageRecord = Record({
|
|
url: '',
|
|
username: '',
|
|
date: Date.now(),
|
|
productId: '',
|
|
});
|
|
|
|
export type ImageFragment = { id: string, images: OrderedSet<typeof ImageRecord> };
|
|
|
|
export const buildImageRecord = (imageRaw: ImageRaw) => {
|
|
return new ImageRecord({
|
|
...imageRaw,
|
|
productId: imageRaw.food_item_id,
|
|
});
|
|
};
|
|
|
|
export default ImageRecord;
|