Skip to content

Commit

Permalink
Introduce ID for the WebHookHistoryMessage struct (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepakriz authored Apr 8, 2024
1 parent 0559007 commit c421173
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions dashboard/src/pages/web-hook-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const App = () => {
const { loading, error, data } = useSubscription<GetWebHookHistorySubscriptionSubscription>(gql`
subscription GetWebHookHistorySubscription {
webHookHistory {
id
createdAt
data
event
Expand Down Expand Up @@ -104,10 +105,7 @@ const App = () => {
</TableHead>
<TableBody>
{data?.webHookHistory.map((webHookHistory) => (
<Row
key={webHookHistory.createdAt}
webHookHistory={webHookHistory}
/>
<Row key={webHookHistory.id} webHookHistory={webHookHistory} />
))}
</TableBody>
</Table>
Expand Down
1 change: 1 addition & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type Queue {
}

type WebHookHistoryRequest {
id: String!
createdAt: Int!
status: WebHookHistoryStatus!
event: String
Expand Down
5 changes: 2 additions & 3 deletions server/src/WebHookServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ interface MergeRequestAssignee {
}

interface MergeRequestHook {
// project: {
// id: number;
// };
object_attributes: {
id: number;
iid: number;
Expand All @@ -51,6 +48,7 @@ const containsAssignedUser = (mergeRequest: MergeRequestHook, user: User): boole
};

type WebHookHistoryMessage = {
id: string;
status: WebHookHistoryStatus;
event?: string;
data?: string;
Expand Down Expand Up @@ -161,6 +159,7 @@ export class WebHookServer {
);
app.post('/', async (req, res) => {
let webHookHistoryMessage: WebHookHistoryMessage = {
id: uuid(),
status: WebHookHistoryStatus.UNAUTHORIZED,
createdAt: Math.floor(Date.now() / 1000),
};
Expand Down

0 comments on commit c421173

Please sign in to comment.