@philipe1993/list-color 1.0.75 → 1.0.77
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorService.d.ts","sourceRoot":"","sources":["../../src/services/ColorService.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ColorService.d.ts","sourceRoot":"","sources":["../../src/services/ColorService.ts"],"names":[],"mappings":"AAIA,cAAM,YAAY;IACR,OAAO,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAS3C;;AAED,wBAAkC"}
|
@@ -37,18 +37,18 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
37
37
|
};
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
39
39
|
var shared_1 = require("@philipe1993/shared");
|
40
|
-
var api = (0, shared_1.getAPIInstance)();
|
41
40
|
var MANAGER = "manager";
|
42
41
|
var ColorService = /** @class */ (function () {
|
43
42
|
function ColorService() {
|
44
43
|
}
|
45
44
|
ColorService.prototype.getList = function (params) {
|
46
45
|
return __awaiter(this, void 0, void 0, function () {
|
47
|
-
var response, e_1;
|
46
|
+
var api, response, e_1;
|
48
47
|
return __generator(this, function (_a) {
|
49
48
|
switch (_a.label) {
|
50
49
|
case 0:
|
51
50
|
_a.trys.push([0, 2, , 3]);
|
51
|
+
api = (0, shared_1.getAPIInstance)();
|
52
52
|
return [4 /*yield*/, api.get("".concat(MANAGER, "/colors/search"), { params: params })];
|
53
53
|
case 1:
|
54
54
|
response = _a.sent();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorService.js","sourceRoot":"","sources":["../../src/services/ColorService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8CAAqD;AACrD,IAAM,
|
1
|
+
{"version":3,"file":"ColorService.js","sourceRoot":"","sources":["../../src/services/ColorService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8CAAqD;AACrD,IAAM,OAAO,GAAG,SAAS,CAAC;AAE1B;IAAA;IAUA,CAAC;IATS,8BAAO,GAAb,UAAc,MAAW;;;;;;;wBAEX,GAAG,GAAG,IAAA,uBAAc,GAAE,CAAC;wBACZ,qBAAM,GAAG,CAAC,GAAG,CAAC,UAAG,OAAO,mBAAgB,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;wBAAhE,QAAQ,GAAG,SAAqD;wBACtE,sBAAO,QAAQ,EAAC,CAAC,4BAA4B;;;wBAE7C,sBAAO,EAAE,KAAK,EAAE,yBAAyB,EAAE,EAAC,CAAC,4BAA4B;;;;;KAEhF;IACL,mBAAC;AAAD,CAAC,AAVD,IAUC;AAED,kBAAe,IAAI,YAAY,EAAE,CAAC"}
|
package/package.json
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "@philipe1993/list-color",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.77",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"types": "dist/index.d.ts",
|
6
6
|
"scripts": {
|
7
7
|
"build": "tsc"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
|
-
"@philipe1993/shared": "^1.0.
|
10
|
+
"@philipe1993/shared": "^1.0.34",
|
11
11
|
"mobx-react-lite": "^4.0.7",
|
12
12
|
"react": "^18.3.1"
|
13
13
|
},
|
@@ -1,53 +1,17 @@
|
|
1
1
|
|
2
2
|
import { getAPIInstance } from "@philipe1993/shared";
|
3
|
-
const api = getAPIInstance();
|
4
3
|
const MANAGER = "manager";
|
5
4
|
|
6
5
|
class ColorService {
|
7
6
|
async getList(params: any): Promise<any> {
|
8
7
|
try {
|
8
|
+
const api = getAPIInstance();
|
9
9
|
const response = await api.get(`${MANAGER}/colors/search`, { params });
|
10
10
|
return response; // Retorna a resposta da API
|
11
11
|
} catch (e) {
|
12
12
|
return { error: "Erro ao trazer listagem" }; // Retorna um objeto de erro
|
13
13
|
}
|
14
14
|
}
|
15
|
-
|
16
|
-
// async createColor(color: any): Promise<any> {
|
17
|
-
// try {
|
18
|
-
// const response = await api.post(`${${MANAGER}/colors}`, color);
|
19
|
-
// return response; // Retorna a resposta da API
|
20
|
-
// } catch (error) {
|
21
|
-
// return { error: "Erro ao cadastrar", details: error }; // Retorna um objeto de erro
|
22
|
-
// }
|
23
|
-
// }
|
24
|
-
|
25
|
-
// async editColor(color: any, uuid: string | undefined): Promise<any> {
|
26
|
-
// try {
|
27
|
-
// const response = await api.put(`${${MANAGER}/colors}/${uuid}`, color);
|
28
|
-
// return response; // Retorna a resposta da API
|
29
|
-
// } catch (error) {
|
30
|
-
// return { error: "Erro ao cadastrar", details: error }; // Retorna um objeto de erro
|
31
|
-
// }
|
32
|
-
// }
|
33
|
-
|
34
|
-
// async getColorByUuid(uuid: any): Promise<any> {
|
35
|
-
// try {
|
36
|
-
// const response = await api.get(`${${MANAGER}/colors}/${uuid}`);
|
37
|
-
// return response; // Retorna a resposta da API
|
38
|
-
// } catch (e) {
|
39
|
-
// return { error: "Erro ao buscar dados" }; // Retorna um objeto de erro
|
40
|
-
// }
|
41
|
-
// }
|
42
|
-
|
43
|
-
// async deleteColor(uuid: any): Promise<any> {
|
44
|
-
// try {
|
45
|
-
// const response = await api.delete(`${${MANAGER}/colors}/${uuid}`);
|
46
|
-
// return response; // Retorna a resposta da API
|
47
|
-
// } catch (e) {
|
48
|
-
// return { error: "Erro ao deletar" }; // Retorna um objeto de erro
|
49
|
-
// }
|
50
|
-
// }
|
51
15
|
}
|
52
16
|
|
53
17
|
export default new ColorService();
|