Skip to content

Commit 769fdb7

Browse files
authored
Merge pull request #394 from the-hideout/skill-images
Add skill images
2 parents 6dd485a + 0cd1ed3 commit 769fdb7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

datasources/tasks.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ class TasksAPI extends WorkerKV {
1515

1616
async get(context, info, id) {
1717
const { cache } = await this.getCache(context, info);
18-
for (const task of cache.Task) {
19-
if (task.id === id || task.tarkovDataId === id) return task;
18+
const task = cache.Task.find(t => t.id === id || t.tarkovDataId === id);
19+
if (!task) {
20+
return Promise.reject(new GraphQLError(`No task found with id ${id}`));
2021
}
21-
return Promise.reject(new GraphQLError(`No task found with id ${id}`));
22+
return task;
2223
}
2324

2425
async getTasksRequiringItem(context, info, itemId) {

schema-static.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ type ServerStatus {
10031003
type Skill {
10041004
id: ID
10051005
name: String
1006+
imageLink: String
10061007
}
10071008
10081009
type SkillLevel {

0 commit comments

Comments
 (0)