mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Updates for http-api verified commits change
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
+20
-5
@@ -274,11 +274,26 @@ export class Project implements ProjectInfo {
|
||||
return api.get(`projects/${urn}/remotes`, {}, host);
|
||||
}
|
||||
|
||||
static async getCommits(urn: string, host: api.Host, parent?: string, since?: string, until?: string, perPage?: string, page?: string): Promise<CommitsHistory> {
|
||||
const params: Record<string, string | undefined> = { parent, since, until, "per-page": perPage, page };
|
||||
// Removes the undefined params.
|
||||
Object.keys(params).forEach(key => params[key] === undefined && delete params[key]);
|
||||
|
||||
static async getCommits(
|
||||
urn: string,
|
||||
host: api.Host,
|
||||
opts?: {
|
||||
parent?: string | null;
|
||||
since?: string;
|
||||
until?: string;
|
||||
perPage?: number;
|
||||
page?: number;
|
||||
verified?: boolean;
|
||||
}
|
||||
): Promise<CommitsHistory> {
|
||||
const params: Record<string, any> = {
|
||||
"parent": opts?.parent,
|
||||
"since": opts?.since,
|
||||
"until": opts?.until,
|
||||
"per-page": opts?.perPage,
|
||||
"page": opts?.page,
|
||||
"verified": opts?.verified
|
||||
};
|
||||
return api.get(`projects/${urn}/commits`, params, host);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user