Skip to content

Commit

Permalink
Adds issue section
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Apr 21, 2024
1 parent 322cb59 commit 8063060
Show file tree
Hide file tree
Showing 16 changed files with 172 additions and 3,228 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace App\Endpoint\Http\Controller;

final class IssuesForContributorsAction
{

}
10 changes: 10 additions & 0 deletions app/app/src/Endpoint/Http/Resource/IssueCollection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace App\Endpoint\Http\Resource;

final class IssueCollection
{

}
10 changes: 10 additions & 0 deletions app/app/src/Endpoint/Http/Resource/IssueResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace App\Endpoint\Http\Resource;

final class IssueResource
{

}
10 changes: 10 additions & 0 deletions app/app/src/Github/Entity/Issue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace App\Github\Entity;

final class Issue
{

}
12 changes: 11 additions & 1 deletion spa/app/api/Api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import apiMethods from '~/app/api/methods';
import { RPCClient } from "~/app/ws/RPCClient";
import { SettingsResponse, TeamMember } from "~/config/types";
import { Issue, SettingsResponse, TeamMember } from "~/config/types";

type SettingsApi = {
get: () => SettingsResponse,
Expand All @@ -14,6 +14,10 @@ type TeamApi = {
list: () => TeamMember[],
}

type IssueApi = {
list: () => Issue[],
}

export default class Api {
private readonly rpc: RPCClient;
private readonly _api_url: string;
Expand All @@ -37,6 +41,12 @@ export default class Api {
}
}

get issue(): IssueApi {
return {
list: apiMethods.issuesForContributors(this.rpc),
}
}

get examples(): ExamplesApi {
return {
call: apiMethods.callExampleAction(this._examples_url),
Expand Down
8 changes: 6 additions & 2 deletions spa/app/api/methods.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
SettingsResponse,
TeamResponse,
ServerResponse
ServerResponse, IssuesResponse
} from "~/config/types";
import { RPCClient } from "~/app/ws/RPCClient";

Expand All @@ -11,6 +11,9 @@ const settings = (rpc: RPCClient) => () => rpc.call('get:api/settings')
const team = (rpc: RPCClient) => () => rpc.call('get:api/team')
.then((response: ServerResponse<TeamResponse>) => response.data.data);

const issuesForContributors = (rpc: RPCClient) => () => rpc.call('get:api/issues/for-contributors')
.then((response: ServerResponse<IssuesResponse>) => response.data.data);

const callExampleAction = (host: string) => (action: string) => {
action = action.toLowerCase();

Expand All @@ -28,5 +31,6 @@ const callExampleAction = (host: string) => (action: string) => {
export default {
settings,
team,
callExampleAction
callExampleAction,
issuesForContributors
}
Loading

0 comments on commit 8063060

Please sign in to comment.