-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MPM-9 Add
usageType
to main settings view (#49)
* Add `usageType` to main settings view * Remove develop statements * Simplify the service * Filter plugins based on valid usage Type * Apply lint fix * More lint fixes * Fix lint after merge * Change case for computed properties to be more consistent with the project.
- Loading branch information
Showing
8 changed files
with
99 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Client from './Client/AxiosClient' | ||
import { baseUrl } from './Client/AxiosClient' | ||
|
||
const resource = `${baseUrl}/api/usage-types` | ||
|
||
export default { | ||
list() { | ||
return Client.get(`${resource}`) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Repository from '../repositories/RepositoryFactory' | ||
import { ErrorHandler } from '@/Helpers/ErrorHander' | ||
|
||
export class UsageTypeListService { | ||
constructor() { | ||
this.repository = Repository.get('usageType') | ||
this.usageTypeList = [] | ||
} | ||
|
||
async list() { | ||
try { | ||
let response = await this.repository.list() | ||
if (response.status === 200) { | ||
this.usageTypeList = response.data.data | ||
return this.usageTypeList | ||
} else { | ||
return new ErrorHandler(response.error, 'http', response.status) | ||
} | ||
} catch (e) { | ||
let erorMessage = e.response.data.message | ||
return new ErrorHandler(erorMessage, 'http') | ||
} | ||
} | ||
} |