@insignia-education/api-sdk-js 0.15.129 → 0.16.0
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 +1 -1
- package/src/api/v1/Blocks.js +8 -4
package/package.json
CHANGED
package/src/api/v1/Blocks.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Sales-and-above: IP blocks (the blocks table — ip-scoped only, see App\Models\Block). */
|
|
2
2
|
export default class Blocks {
|
|
3
3
|
#client;
|
|
4
4
|
|
|
@@ -6,7 +6,11 @@ export default class Blocks {
|
|
|
6
6
|
this.#client = client;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/** `id` fetches one block; omitted fetches the paginated list — `{ page, perPage }` control that page. */
|
|
10
|
+
get(id = null, { page, perPage } = {}) {
|
|
11
|
+
return id ? this.#client.get(`/blocks/${id}`) : this.#client.get('/blocks', { page, per_page: perPage });
|
|
12
|
+
}
|
|
13
|
+
create(data) { return this.#client.put('/blocks', data); }
|
|
14
|
+
edit(id, data) { return this.#client.patch(`/blocks/${id}`, data); }
|
|
15
|
+
delete(id) { return this.#client.del(`/blocks/${id}`); }
|
|
12
16
|
}
|