mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
[WEB-3048] feat: added-stickies (#6339)
* feat: added-stickies * fix: recents empty state fixed * fix: added border * Change sort_order field * fix: remvoved btn * fix: sticky toolbar * fix: build * fix: sticky search * fix: minor css fix * fix: issue identifier css handled * fix: issue type default icon * fix: added tooltip for color palette and delete --------- Co-authored-by: sangeethailango <sangeethailango21@gmail.com>
This commit is contained in:
60
web/core/services/sticky.service.ts
Normal file
60
web/core/services/sticky.service.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
// helpers
|
||||
import { TSticky } from "@plane/types";
|
||||
import { API_BASE_URL } from "@/helpers/common.helper";
|
||||
// services
|
||||
import { APIService } from "@/services/api.service";
|
||||
|
||||
export class StickyService extends APIService {
|
||||
constructor() {
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createSticky(workspaceSlug: string, payload: Partial<TSticky>) {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/stickies/`, payload)
|
||||
.then((res) => res?.data)
|
||||
.catch((err) => {
|
||||
throw err?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async getStickies(
|
||||
workspaceSlug: string,
|
||||
cursor?: string,
|
||||
per_page?: number
|
||||
): Promise<{ results: TSticky[]; total_pages: number }> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/stickies/`, {
|
||||
params: {
|
||||
cursor: cursor || `5:0:0`,
|
||||
per_page: per_page || 5,
|
||||
},
|
||||
})
|
||||
.then((res) => res?.data)
|
||||
.catch((err) => {
|
||||
throw err?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async getSticky(workspaceSlug: string, id: string) {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/stickies/${id}`)
|
||||
.then((res) => res?.data)
|
||||
.catch((err) => {
|
||||
throw err?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async updateSticky(workspaceSlug: string, id: string, data: Partial<TSticky>) {
|
||||
return await this.patch(`/api/workspaces/${workspaceSlug}/stickies/${id}/`, data)
|
||||
.then((res) => res?.data)
|
||||
.catch((err) => {
|
||||
throw err?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async deleteSticky(workspaceSlug: string, id: string) {
|
||||
return await this.delete(`/api/workspaces/${workspaceSlug}/stickies/${id}`)
|
||||
.then((res) => res?.data)
|
||||
.catch((err) => {
|
||||
throw err?.response?.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user