Add file support

This commit is contained in:
Tobias Lins
2020-07-18 18:16:25 +02:00
parent 1295bbea5d
commit 35e48d1d3f
2 changed files with 8 additions and 2 deletions

View File

@@ -37,7 +37,8 @@ export type ColumnType =
| "title"
| "multi_select"
| "number"
| "relation";
| "relation"
| "file";
export type ColumnSchemaType = {
name: string;
@@ -53,7 +54,8 @@ export type RowContentType =
| string[]
| { title: string; id: string }
| UserType[]
| DecorationType[];
| DecorationType[]
| { name: string; url: string }[];
export interface BaseValueType {
id: string;

View File

@@ -41,6 +41,10 @@ export const getNotionValue = (
return val
.filter(([symbol]) => symbol === "‣")
.map(([_, relation]) => relation![0][1] as string);
case "file":
return val
.filter((v) => v.length > 1)
.map((v) => ({ name: v[0] as string, url: v[1]![0][1] as string }));
default:
console.log({ val, type });
return "Not supported";