Skip to content

Commit

Permalink
PATCH: fix: remove service constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Oct 25, 2023
1 parent 940a72d commit 67c20c6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ import { getPriorityColor } from "./utils/topic.js";
import { downloadBlobAs } from "./utils/download.js";

class Service {
constructor () {
if (!Service.instance) Service.instance = this;
return Service.instance;
}

setup({ apiClient, fetchUsers }) {
this.apiClient = apiClient;
this.fetchUsers = fetchUsers;
}

_getUsers(project) {
return this.fetchUsers
? this.fetchUsers(project)
: this.apiClient.collaborationApi.getProjectUsers(project.cloud.id, project.id);
return (
this.fetchUsers?.(project) ??
this.apiClient.collaborationApi.getProjectUsers(project.cloud.id, project.id)
);
}

fetchCurrentUser() {
Expand Down

0 comments on commit 67c20c6

Please # to comment.