| 2151 | }); |
| 2152 | }, |
| 2153 | async batchSetPurchaseTag(ids, { tagId, tagName } = {}) { |
| 2154 | const body = { |
| 2155 | ids: (Array.isArray(ids) ? ids : []).map((id) => Number(id)).filter((id) => Number.isFinite(id) && id > 0), |
| 2156 | }; |
| 2157 | if (tagId !== undefined) { |
| 2158 | body.tag_id = Number(tagId) || 0; |
| 2159 | } |
| 2160 | if (tagName !== undefined) { |
| 2161 | body.tag_name = String(tagName || '').trim(); |
| 2162 | } |
| 2163 | await request('POST', '/api/v1/openapi/email/purchases/batch-tag', { |
| 2164 | jsonData: body, |
| 2165 | }); |
| 2166 | }, |
| 2167 | async getTags() { |
| 2168 | return normalizeLuckmailTags(await request('GET', '/api/v1/openapi/email/tags')); |
| 2169 | }, |