Skip to content

Commit

Permalink
Add Group model Interface
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Oct 12, 2024
1 parent a6d010c commit 970be8a
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 5 deletions.
24 changes: 24 additions & 0 deletions app/assets/interfaces/groupInterface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* By default, the frontend group object will have the same interface as the PHP user.
* Note that any Sprinkle can (and should!) extend this interface.
*
* Example:
* - id: 1
* - slug: "hippo"
* - name: "Hippopotamus"
* - description: "The group dedicated to the hippopotamus family."
* - icon: "hippo"
* - created_at: "2023-09-16T19:23:59.000000Z"
* - updated_at: "2023-09-16T19:23:59.000000Z"
* - deleted_at: null
*/
export interface GroupInterface {
id: number
slug: string
name: string
description: string
icon: string
created_at: Date | string
updated_at: Date | string
deleted_at: Date | string | null
}
3 changes: 2 additions & 1 deletion app/assets/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { LoginForm } from './loginForm'
import type { UserInterface } from './userInterface'
import type { GroupInterface } from './groupInterface'
import type { RouteGuard } from './routes'

export type { LoginForm, UserInterface, RouteGuard }
export type { LoginForm, UserInterface, GroupInterface, RouteGuard }
24 changes: 24 additions & 0 deletions dist/interfaces/groupInterface.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* By default, the frontend group object will have the same interface as the PHP user.
* Note that any Sprinkle can (and should!) extend this interface.
*
* Example:
* - id: 1
* - slug: "hippo"
* - name: "Hippopotamus"
* - description: "The group dedicated to the hippopotamus family."
* - icon: "hippo"
* - created_at: "2023-09-16T19:23:59.000000Z"
* - updated_at: "2023-09-16T19:23:59.000000Z"
* - deleted_at: null
*/
export interface GroupInterface {
id: number;
slug: string;
name: string;
description: string;
icon: string;
created_at: Date | string;
updated_at: Date | string;
deleted_at: Date | string | null;
}
3 changes: 2 additions & 1 deletion dist/interfaces/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LoginForm } from './loginForm';
import { UserInterface } from './userInterface';
import { GroupInterface } from './groupInterface';
import { RouteGuard } from './routes';
export type { LoginForm, UserInterface, RouteGuard };
export type { LoginForm, UserInterface, GroupInterface, RouteGuard };
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
"app/assets/",
"dist/"
],
"dependencies": {

},
"dependencies": {},
"peerDependencies": {
"vue": "^3.4.21",
"vue-router": "^4.2.4",
Expand Down

0 comments on commit 970be8a

Please sign in to comment.