+
{{ $t('add') }}
-
- {{ item.name }}
+
+
+ {{ item.name }}
+ {{ item.description }}
+
@@ -76,3 +79,26 @@ export default defineComponent({
}
});
+
+
diff --git a/src/client/router.ts b/src/client/router.ts
index da2945be2c..413e72c320 100644
--- a/src/client/router.ts
+++ b/src/client/router.ts
@@ -37,6 +37,7 @@ export const router = createRouter({
{ path: '/channels/new', component: page('channel-editor') },
{ path: '/channels/:channelId/edit', component: page('channel-editor'), props: true },
{ path: '/channels/:channelId', component: page('channel'), props: route => ({ channelId: route.params.channelId }) },
+ { path: '/clips/:clipId', component: page('clip'), props: route => ({ clipId: route.params.clipId }) },
{ path: '/my/notifications', component: page('notifications') },
{ path: '/my/favorites', component: page('favorites') },
{ path: '/my/messages', component: page('messages') },
diff --git a/src/models/repositories/clip.ts b/src/models/repositories/clip.ts
index 7cc3fb7110..f5c70a1829 100644
--- a/src/models/repositories/clip.ts
+++ b/src/models/repositories/clip.ts
@@ -15,8 +15,10 @@ export class ClipRepository extends Repository
{
return {
id: clip.id,
createdAt: clip.createdAt.toISOString(),
+ userId: clip.userId,
name: clip.name,
description: clip.description,
+ isPublic: clip.isPublic,
};
}
}
@@ -38,6 +40,11 @@ export const packedClipSchema = {
format: 'date-time',
description: 'The date that the Clip was created.'
},
+ userId: {
+ type: 'string' as const,
+ optional: false as const, nullable: false as const,
+ format: 'id',
+ },
name: {
type: 'string' as const,
optional: false as const, nullable: false as const,
@@ -48,5 +55,10 @@ export const packedClipSchema = {
optional: false as const, nullable: true as const,
description: 'The description of the Clip.'
},
+ isPublic: {
+ type: 'boolean' as const,
+ optional: false as const, nullable: false as const,
+ description: 'Whether this Clip is public.',
+ },
},
};
diff --git a/src/server/api/endpoints/clips/update.ts b/src/server/api/endpoints/clips/update.ts
index 483941214c..4a1a31eb95 100644
--- a/src/server/api/endpoints/clips/update.ts
+++ b/src/server/api/endpoints/clips/update.ts
@@ -18,6 +18,14 @@ export const meta = {
name: {
validator: $.str.range(1, 100),
+ },
+
+ isPublic: {
+ validator: $.optional.bool
+ },
+
+ description: {
+ validator: $.optional.nullable.str.range(1, 2048)
}
},
@@ -42,7 +50,9 @@ export default define(meta, async (ps, user) => {
}
await Clips.update(clip.id, {
- name: ps.name
+ name: ps.name,
+ description: ps.description,
+ isPublic: ps.isPublic,
});
return await Clips.pack(clip.id);