Skip to content

Commit

Permalink
wip: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Esurio committed Sep 9, 2024
1 parent 4cf017d commit 8b44e40
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/backend/src/core/NoteUpdateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export class NoteUpdateService implements OnApplicationShutdown {
attachedFileTypes: data.files ? data.files.map(file => file.type) : [],
updatedAtHistory: [...updatedAtHistory, new Date()],
noteEditHistory: [...note.noteEditHistory, (note.cw ? note.cw + '\n' : '') + note.text!],
searchableBy: note.searchableBy,
});

// 投稿を更新
Expand Down
2 changes: 2 additions & 0 deletions packages/backend/src/server/api/endpoints/notes/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const paramDef = {
},
cw: { type: 'string', nullable: true, maxLength: 100 },
disableRightClick: { type: 'boolean', default: false },
searchableBy: { type: 'string', enum: ['public', 'followers', 'reacted', 'limited'], default: 'public' },
},
required: ['noteId', 'text', 'cw'],
} as const;
Expand Down Expand Up @@ -153,6 +154,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
multiple: ps.poll.multiple ?? false,
expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null,
} : undefined,
searchableBy: ps.searchableBy,
};

const updatedNote = await this.noteUpdateService.update(me, data, note, false);
Expand Down
5 changes: 5 additions & 0 deletions packages/cherrypick-js/src/autogen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21787,6 +21787,11 @@ export type operations = {
cw: string | null;
/** @default false */
disableRightClick?: boolean;
/**
* @default public
* @enum {string}
*/
searchableBy?: 'public' | 'followers' | 'reacted' | 'limited';
};
};
};
Expand Down

0 comments on commit 8b44e40

Please sign in to comment.