Skip to content

Commit

Permalink
Merge pull request #419 from m-rolana/missing-locale-support-for-tick…
Browse files Browse the repository at this point in the history
…et_fields-list

add listWithLocale for ticket_fields entity
  • Loading branch information
blakmatrix authored Aug 1, 2024
2 parents 6dfa21b + d1b77a3 commit 979fed6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/clients/core/ticketfields.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TicketFields extends Client {

/**
* Lists all ticket fields.
* @returns {Promise<Array<TicketField>>}>} Returns an array of ticket fields.
* @returns {Promise<Array<TicketField>>}} Returns an array of ticket fields.
* @async
* @throws {Error} Throws an error if the request fails.
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/#list-ticket-fields}
Expand All @@ -59,6 +59,20 @@ class TicketFields extends Client {
return this.getAll(['ticket_fields']);
}

/**
* Lists all ticket fields with locale.
* @returns {Promise<Array<TicketField>>}} Returns an array of ticket fields by locale.
* @async
* @throws {Error} Throws an error if the request fails.
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/#list-ticket-fields}
* @example
* const client = createClient({...});
* const fields = await client.ticketfields.listWithLocale('sv');
*/
async listWithLocale(locale) {
return this.getAll(['ticket_fields', { locale }]);

Check failure on line 73 in src/clients/core/ticketfields.js

View workflow job for this annotation

GitHub Actions / build-and-deploy

Replace `·locale·` with `locale`
}

/**
* Retrieves a specific ticket field by ID.
* @param {number} ticketFieldId - The ID of the ticket field to retrieve.
Expand Down

0 comments on commit 979fed6

Please sign in to comment.