1 parent
564ece4ff3
commit
c0e815ae63
3 files changed
+292
-4
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { apiClient } from '@/lib/api-client.ts'
|
||||
import type { User } from '@/api/user.api.ts'
|
||||
|
||||
/** created — a pseudo-field: the issue creation record, both values are null */
|
||||
export type IssueChangeField = 'created' | 'title' | 'content' | 'status' | 'priority' | 'assignee' | 'dueDate'
|
||||
|
||||
/** Values are serialized: priority — number, dueDate — ISO date, assignee — user id */
|
||||
export interface IssueFieldChange {
|
||||
field: IssueChangeField
|
||||
oldValue: string | null
|
||||
newValue: string | null
|
||||
/** Only for field = assignee: null — unassigned or the user was deleted */
|
||||
oldUser?: User | null
|
||||
newUser?: User | null
|
||||
}
|
||||
|
||||
/** One save of the issue: who, when and which fields changed */
|
||||
export interface IssueHistoryEntry {
|
||||
/** changeId */
|
||||
id: string
|
||||
changedAt: string
|
||||
actorId: string | null
|
||||
/** null — system change or the actor deleted their account */
|
||||
actor: User | null
|
||||
changes: IssueFieldChange[]
|
||||
}
|
||||
|
||||
// CLIENT REQUEST
|
||||
|
||||
/** Oldest first */
|
||||
export async function itemsList(issueId: number) {
|
||||
return apiClient.get<IssueHistoryEntry[]>(`/api/issues/${issueId}/history`)
|
||||
}
|
||||
Reference in new issue
Block a user