enable primary button (#673)

* feat: enable primary button

* feat: better attachments

* fix: unneeded param
This commit is contained in:
Tonya
2025-05-05 01:43:38 +00:00
committed by GitHub
parent 8fb0ae64d7
commit 232dc08fcd
3 changed files with 33 additions and 36 deletions

View File

@@ -32,13 +32,14 @@ export type ItemsQuery = {
};
export class AttachmentsAPI extends BaseAPI {
add(id: string, file: File | Blob, filename: string, type: AttachmentTypes | null = null) {
add(id: string, file: File | Blob, filename: string, type: AttachmentTypes | null = null, primary: boolean = false) {
const formData = new FormData();
formData.append("file", file);
if (type) {
formData.append("type", type);
}
formData.append("name", filename);
formData.append("primary", primary.toString());
return this.http.post<FormData, ItemOut>({
url: route(`/items/${id}/attachments`),