Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flash/update で部分的に変更できるようにする #13396

Merged
merged 9 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

### Server
- Fix: nodeinfoにenableMcaptchaとenableTurnstileが無いのを修正
- エンドポイント`flash/update`の`flashId`以外のパラメータは必須ではなくなりました

## 2024.2.0

Expand Down
12 changes: 6 additions & 6 deletions packages/backend/src/server/api/endpoints/flash/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const paramDef = {
} },
visibility: { type: 'string', enum: ['public', 'private'] },
},
required: ['flashId', 'title', 'summary', 'script', 'permissions'],
required: ['flashId'],
} as const;

@Injectable()
Expand All @@ -71,11 +71,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

await this.flashsRepository.update(flash.id, {
updatedAt: new Date(),
title: ps.title,
summary: ps.summary,
script: ps.script,
permissions: ps.permissions,
visibility: ps.visibility,
...Object.fromEntries(
Object.entries(ps).filter(
([key, val]) => (key !== 'flashId') && Object.prototype.hasOwnProperty.call(paramDef.properties, key)
FineArchs marked this conversation as resolved.
Show resolved Hide resolved
)
),
});
});
}
Expand Down
8 changes: 4 additions & 4 deletions packages/misskey-js/src/autogen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22925,10 +22925,10 @@ export type operations = {
'application/json': {
/** Format: misskey:id */
flashId: string;
title: string;
summary: string;
script: string;
permissions: string[];
title?: string;
summary?: string;
script?: string;
permissions?: string[];
/** @enum {string} */
visibility?: 'public' | 'private';
};
Expand Down
Loading