@nativesquare/upwork 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "bugs": {
7
7
  "url": "https://github.com/NativeSquare/upwork/issues"
8
8
  },
9
- "version": "0.2.0",
9
+ "version": "0.2.1",
10
10
  "license": "Apache-2.0",
11
11
  "keywords": [
12
12
  "convex",
@@ -58,20 +58,19 @@ export class Upwork {
58
58
  }
59
59
 
60
60
  async getJobPosting(
61
- ctx: ActionCtx,
61
+ ctx: QueryCtx,
62
62
  opts: { upworkId: string },
63
63
  ): Promise<JobPosting | null> {
64
- const cached = await ctx.runQuery(this.component.public.getJobPosting, {
65
- upworkId: opts.upworkId,
66
- });
67
- if (cached) return cached;
68
-
69
- const fetched = await ctx.runAction(this.component.public.fetchJobPosting, {
64
+ return await ctx.runQuery(this.component.public.getJobPosting, {
70
65
  upworkId: opts.upworkId,
71
66
  });
72
- if (!fetched) return null;
67
+ }
73
68
 
74
- return await ctx.runQuery(this.component.public.getJobPosting, {
69
+ async fetchJobPosting(
70
+ ctx: ActionCtx,
71
+ opts: { upworkId: string },
72
+ ): Promise<JobPosting | null> {
73
+ return await ctx.runAction(this.component.public.fetchJobPosting, {
75
74
  upworkId: opts.upworkId,
76
75
  });
77
76
  }