Skip to content

Commit 12d095f

Browse files
committed
Merge branch 'main' of https://github.com/the-hideout/tarkov-api into handbook-image-links
2 parents f55f3f5 + b2c3de7 commit 12d095f

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
@@ -1007,6 +1007,7 @@ type ServerStatus {
10071007
type Skill {
10081008
id: ID
10091009
name: String
1010+
imageLink: String
10101011
}
10111012
10121013
type SkillLevel {

0 commit comments

Comments
 (0)