stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
30 lines (26 loc) • 600 B
text/typescript
import { SharedLocationResponse } from 'stream-chat';
import type { TableRow } from '../types';
export const mapStorableToSharedLocation = (row: TableRow<'locations'>): SharedLocationResponse => {
const {
channelCid,
createdAt,
createdByDeviceId,
endAt,
latitude,
longitude,
messageId,
updatedAt,
userId,
} = row;
return {
channel_cid: channelCid,
created_at: createdAt,
created_by_device_id: createdByDeviceId,
end_at: endAt,
latitude,
longitude,
message_id: messageId,
updated_at: updatedAt,
user_id: userId,
};
};