Skip to content

Commit

Permalink
Update data-service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
bsu3338 committed Apr 12, 2024
1 parent aab6ced commit 0a025f1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/data-provider/src/data-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ export function updateUserKey(payload: t.TUpdateUserKeyRequest) {
return request.put(endpoints.keys(), payload);
}

export function getUserPreference(name: string): Promise<t.TPreference> {
return request.get(endpoints.preferencesQuery(name));
}

export function updateUserPreference(payload: t.TPreference) {
const { value } = payload;
if (!value) {
throw new Error('value is required');
}
return request.put(endpoints.preferences(), payload);
}

export function getPresets(): Promise<s.TPreset[]> {
return request.get(endpoints.presets());
}
Expand Down

0 comments on commit 0a025f1

Please sign in to comment.