mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-06 13:12:36 +00:00
16 lines
560 B
TypeScript
16 lines
560 B
TypeScript
import { Shortcut as ShortcutPb } from "@/types/proto/api/v2/shortcut_service";
|
|
|
|
export const convertShortcutFromPb = (shortcutMessage: ShortcutPb): Shortcut => {
|
|
return {
|
|
id: shortcutMessage.id,
|
|
creatorId: shortcutMessage.creatorId,
|
|
createdTs: shortcutMessage.createdTime?.getTime() || 0,
|
|
updatedTs: shortcutMessage.updatedTime?.getTime() || 0,
|
|
name: shortcutMessage.name,
|
|
link: shortcutMessage.link,
|
|
title: shortcutMessage.title,
|
|
description: shortcutMessage.description,
|
|
tags: shortcutMessage.tags,
|
|
} as Shortcut;
|
|
};
|