Skip to content

Commit e2a5e17

Browse files
committed
Add types to arguments
1 parent 7b07ebe commit e2a5e17

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@freenit-framework/core",
3-
"version": "0.0.43",
3+
"version": "0.0.44",
44
"private": false,
55
"author": "Goran Mekić <meka@tilda.center>",
66
"license": "BSD-2-Clause",

src/lib/base-store/auth.svelte.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default class AuthStore {
99
this.prefix = prefix
1010
}
1111

12-
login = async (email, password) => {
12+
login = async (email: string, password: string) => {
1313
const response = await methods.post(`${this.prefix}/auth/login`, {
1414
email,
1515
password,
@@ -37,7 +37,7 @@ export default class AuthStore {
3737
return response
3838
}
3939

40-
register = async (email, password) => {
40+
register = async (email: string, password: string) => {
4141
const response = await methods.post(`${this.prefix}/auth/register`, {
4242
email,
4343
password,
@@ -49,9 +49,9 @@ export default class AuthStore {
4949
return response
5050
}
5151

52-
verify = async (verification) => {
52+
verify = async (token: string) => {
5353
const response = await methods.post(`${this.prefix}/auth/verify`, {
54-
verification,
54+
verification: token,
5555
})
5656
if (response.ok) {
5757
const data = await response.json()

src/lib/base-store/role.svelte.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class RoleStore {
2323
return response
2424
}
2525

26-
create = async (fields) => {
26+
create = async (fields: Record<string, any>) => {
2727
await this.store.auth.refresh_token()
2828
const response = await methods.post(`${this.prefix}/roles`, fields)
2929
if (response.ok) {
@@ -33,7 +33,7 @@ export default class RoleStore {
3333
return response
3434
}
3535

36-
fetch = async (id) => {
36+
fetch = async (id: number) => {
3737
await this.store.auth.refresh_token()
3838
const response = await methods.get(`${this.prefix}/roles/${id}`)
3939
if (response.ok) {
@@ -45,7 +45,7 @@ export default class RoleStore {
4545
return response
4646
}
4747

48-
edit = async (id) => {
48+
edit = async (id: number) => {
4949
await this.store.auth.refresh_token()
5050
const response = await methods.patch(`${this.prefix}/roles/${id}`, fields)
5151
if (response.ok) {
@@ -56,7 +56,7 @@ export default class RoleStore {
5656
return response
5757
}
5858

59-
destroy = async (id) => {
59+
destroy = async (id: number) => {
6060
await this.store.auth.refresh_token()
6161
const response = await methods.delete(`${this.prefix}/roles/${id}`)
6262
if (response.ok) {
@@ -67,7 +67,7 @@ export default class RoleStore {
6767
return response
6868
}
6969

70-
assign = async (role_id, user_id) => {
70+
assign = async (role_id: number, user_id: number) => {
7171
await this.store.auth.refresh_token()
7272
const response = await methods.post(`${this.prefix}/roles/${role_id}/${user_id}`, {})
7373
if (response.ok) {
@@ -77,7 +77,7 @@ export default class RoleStore {
7777
return response
7878
}
7979

80-
deassign = async (role_id, user_id) => {
80+
deassign = async (role_id: number, user_id: number) => {
8181
await this.store.auth.refresh_refresh()
8282
const response = await methods.delete(`${this.prefix}/roles/${role_id}/${user_id}`)
8383
if (response.ok) {

src/lib/base-store/theme.svelte.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class ThemeStore {
2020
return response
2121
}
2222

23-
create = async (fields) => {
23+
create = async (fields: Record<string, any>) => {
2424
await this.store.auth.refresh_token()
2525
const response = await methods.post(`${this.prefix}/themes`, fields)
2626
if (response.ok) {
@@ -42,7 +42,7 @@ export default class ThemeStore {
4242
}
4343

4444

45-
fetch = async (name) => {
45+
fetch = async (name: string) => {
4646
const response = await methods.get(`${this.prefix}/themes/${name}`)
4747
if (response.ok) {
4848
const data = await response.json()
@@ -52,7 +52,7 @@ export default class ThemeStore {
5252
return response
5353
}
5454

55-
edit = async (name, fields) => {
55+
edit = async (name: string, fields: Record<string, fields>) => {
5656
await this.store.auth.refresh_token()
5757
const response = await methods.patch(`${this.prefix}/themes/${name}`, fields)
5858
if (response.ok) {
@@ -63,7 +63,7 @@ export default class ThemeStore {
6363
return response
6464
}
6565

66-
destroy = async (name) => {
66+
destroy = async (name: string) => {
6767
await this.store.auth.refresh_token()
6868
const response = await methods.delete(`${this.prefix}/themes/${name}`)
6969
if (response.ok) {

src/lib/base-store/user.svelte.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default class UserStore {
2121
return response
2222
}
2323

24-
create = async (fields) => {
24+
create = async (fields: Record<string, any>) => {
2525
await this.store.auth.refresh_token()
2626
const response = await methods.post(`${this.prefix}/users`, fields)
2727
if (response.ok) {
@@ -32,7 +32,7 @@ export default class UserStore {
3232
return response
3333
}
3434

35-
fetch = async (id) => {
35+
fetch = async (id: number) => {
3636
await this.store.auth.refresh_token()
3737
const response = await methods.get(`${this.prefix}/users/${id}`)
3838
if (response.ok) {
@@ -43,7 +43,7 @@ export default class UserStore {
4343
return response
4444
}
4545

46-
edit = async (id, fields) => {
46+
edit = async (id: number, fields: Record<string, any>) => {
4747
await this.store.auth.refresh_token()
4848
const response = await methods.patch(`${this.prefix}/users/${id}`, fields)
4949
if (response.ok) {
@@ -65,7 +65,7 @@ export default class UserStore {
6565
return response
6666
}
6767

68-
editProfile = async (fields) => {
68+
editProfile = async (fields: Record<string, any>) => {
6969
await this.store.auth.refresh_token()
7070
const response = await methods.patch(`${this.prefix}/profile`, fields)
7171
if (response.ok) {

0 commit comments

Comments
 (0)