settings wip

This commit is contained in:
vabene1111
2022-07-15 17:12:01 +02:00
parent 8700e2df69
commit ce1f55ffd1
23 changed files with 801 additions and 90 deletions

View File

@@ -205,7 +205,7 @@
@change="recipe.shared = $event.val"
parent_variable="recipe.shared"
:initial_selection="recipe.shared"
:label="'username'"
:label="'display_name'"
:model="Models.USER_NAME"
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
v-bind:placeholder="$t('Share')"

View File

@@ -23,8 +23,18 @@
</b-nav>
</div>
<div class="col-md-9 col-12">
Overview
<cosmetic-settings-component v-if="visible_settings === 'cosmetic'" :user_id="user_id"></cosmetic-settings-component>
<cosmetic-settings-component v-if="visible_settings === 'cosmetic'"
:user_id="user_id"></cosmetic-settings-component>
<account-settings-component v-if="visible_settings === 'account'"
:user_id="user_id"></account-settings-component>
<search-settings-component v-if="visible_settings === 'search'"
:user_id="user_id"></search-settings-component>
<shopping-settings-component v-if="visible_settings === 'shopping'"
:user_id="user_id"></shopping-settings-component>
<meal-plan-settings-component v-if="visible_settings === 'meal_plan'"
:user_id="user_id"></meal-plan-settings-component>
<a-p-i-settings-component v-if="visible_settings === 'api'" :user_id="user_id"></a-p-i-settings-component>
</div>
</div>
</template>
@@ -34,18 +44,26 @@ import Vue from "vue"
import {BootstrapVue} from "bootstrap-vue"
import "bootstrap-vue/dist/bootstrap-vue.css"
import {ApiApiFactory} from "@/utils/openapi/api"
import CookbookSlider from "@/components/CookbookSlider"
import LoadingSpinner from "@/components/LoadingSpinner"
import {StandardToasts, ApiMixin} from "@/utils/utils"
import CosmeticSettingsComponent from "@/components/Settings/CosmeticSettingsComponent";
import AccountSettingsComponent from "@/components/Settings/AccountSettingsComponent";
import SearchSettingsComponent from "@/components/Settings/SearchSettingsComponent";
import ShoppingSettingsComponent from "@/components/Settings/ShoppingSettingsComponent";
import MealPlanSettingsComponent from "@/components/Settings/MealPlanSettingsComponent";
import APISettingsComponent from "@/components/Settings/APISettingsComponent";
Vue.use(BootstrapVue)
export default {
name: "ProfileView",
mixins: [],
components: {CosmeticSettingsComponent},
components: {
CosmeticSettingsComponent,
AccountSettingsComponent,
SearchSettingsComponent,
ShoppingSettingsComponent,
MealPlanSettingsComponent,
APISettingsComponent
},
data() {
return {
visible_settings: 'cosmetic',
@@ -55,9 +73,7 @@ export default {
mounted() {
this.$i18n.locale = window.CUSTOM_LOCALE
},
methods: {
},
methods: {},
}
</script>

View File

@@ -514,7 +514,7 @@
"
:model="Models.USER"
:initial_selection="settings.shopping_share"
label="username"
label="display_name"
:multiple="true"
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
:placeholder="$t('User')"
@@ -868,7 +868,7 @@ export default {
case "category":
return item?.food?.supermarket_category?.name ?? x
case "created_by":
return item?.created_by?.username ?? x
return item?.created_by?.display_name ?? x
case "recipe":
return item?.recipe_mealplan?.recipe_name ?? x
}

View File

@@ -5,7 +5,7 @@
{{ book_copy.icon }}&nbsp;{{ book_copy.name }}
<span class="float-right text-primary" @click="editOrSave"><i class="fa" v-bind:class="{ 'fa-pen': !editing, 'fa-save': editing }" aria-hidden="true"></i></span>
</h5>
<b-badge class="font-weight-normal mr-1" v-for="u in book_copy.shared" v-bind:key="u.id" variant="primary" pill>{{ u.username }}</b-badge>
<b-badge class="font-weight-normal mr-1" v-for="u in book_copy.shared" v-bind:key="u.id" variant="primary" pill>{{ u.display_name }}</b-badge>
</b-card-header>
<b-card-body class="p-4">
<div class="form-group" v-if="editing">
@@ -25,7 +25,7 @@
@change="book_copy.shared = $event.val"
parent_variable="book.shared"
:initial_selection="book.shared"
:label="'username'"
:label="'display_name'"
:model="Models.USER_NAME"
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
v-bind:placeholder="$t('Share')"

View File

@@ -64,7 +64,7 @@
required
@change="entryEditing.shared = $event.val"
parent_variable="entryEditing.shared"
:label="'username'"
:label="'display_name'"
:model="Models.USER_NAME"
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
v-bind:placeholder="$t('Share')"

View File

@@ -0,0 +1,59 @@
<template>
<div v-if="user_preferences !== undefined">
</div>
</template>
<script>
import {ApiApiFactory} from "@/utils/openapi/api";
import {StandardToasts} from "@/utils/utils";
import axios from "axios";
axios.defaults.xsrfCookieName = 'csrftoken'
axios.defaults.xsrfHeaderName = "X-CSRFTOKEN"
export default {
name: "APISettingsComponent",
props: {
user_id: Number,
},
data() {
return {
user_preferences: undefined,
languages: [],
}
},
mounted() {
this.user_preferences = this.preferences
this.languages = window.AVAILABLE_LANGUAGES
this.loadSettings()
},
methods: {
loadSettings: function () {
let apiFactory = new ApiApiFactory()
apiFactory.retrieveUserPreference(this.user_id.toString()).then(result => {
this.user_preferences = result.data
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
})
},
updateSettings: function (reload) {
let apiFactory = new ApiApiFactory()
apiFactory.partialUpdateUserPreference(this.user_id.toString(), this.user_preferences).then(result => {
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_UPDATE)
if (reload !== undefined) {
location.reload()
}
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_UPDATE, err)
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,78 @@
<template>
<div v-if="user !== undefined">
<b-form-input v-model="user.username" @change="updateUser(false)" disabled></b-form-input>
<b-form-input v-model="user.first_name" @change="updateUser(false)"></b-form-input>
<b-form-input v-model="user.last_name" @change="updateUser(false)"></b-form-input>
</div>
</template>
<script>
import {ApiApiFactory} from "@/utils/openapi/api";
import {StandardToasts} from "@/utils/utils";
import axios from "axios";
axios.defaults.xsrfCookieName = 'csrftoken'
axios.defaults.xsrfHeaderName = "X-CSRFTOKEN"
export default {
name: "AccountSettingsComponent",
props: {
user_id: Number,
},
data() {
return {
user_preferences: undefined,
user: undefined,
languages: [],
}
},
mounted() {
this.user_preferences = this.preferences
this.languages = window.AVAILABLE_LANGUAGES
this.loadSettings()
},
methods: {
loadSettings: function () {
let apiFactory = new ApiApiFactory()
apiFactory.retrieveUserPreference(this.user_id.toString()).then(result => {
this.user_preferences = result.data
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
})
apiFactory.retrieveUser(this.user_id.toString()).then(result => {
this.user = result.data
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
})
},
updateSettings: function (reload) {
let apiFactory = new ApiApiFactory()
apiFactory.partialUpdateUserPreference(this.user_id.toString(), this.user_preferences).then(result => {
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_UPDATE)
if (reload !== undefined) {
location.reload()
}
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_UPDATE, err)
})
},
updateUser: function (reload) {
let apiFactory = new ApiApiFactory()
apiFactory.partialUpdateUser(this.user_id.toString(), this.user).then(result => {
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_UPDATE)
if (reload) {
location.reload()
}
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_UPDATE, err)
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,59 @@
<template>
<div v-if="user_preferences !== undefined">
</div>
</template>
<script>
import {ApiApiFactory} from "@/utils/openapi/api";
import {StandardToasts} from "@/utils/utils";
import axios from "axios";
axios.defaults.xsrfCookieName = 'csrftoken'
axios.defaults.xsrfHeaderName = "X-CSRFTOKEN"
export default {
name: "MealPlanSettingsComponent",
props: {
user_id: Number,
},
data() {
return {
user_preferences: undefined,
languages: [],
}
},
mounted() {
this.user_preferences = this.preferences
this.languages = window.AVAILABLE_LANGUAGES
this.loadSettings()
},
methods: {
loadSettings: function () {
let apiFactory = new ApiApiFactory()
apiFactory.retrieveUserPreference(this.user_id.toString()).then(result => {
this.user_preferences = result.data
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
})
},
updateSettings: function (reload) {
let apiFactory = new ApiApiFactory()
apiFactory.partialUpdateUserPreference(this.user_id.toString(), this.user_preferences).then(result => {
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_UPDATE)
if (reload !== undefined) {
location.reload()
}
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_UPDATE, err)
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,59 @@
<template>
<div v-if="user_preferences !== undefined">
</div>
</template>
<script>
import {ApiApiFactory} from "@/utils/openapi/api";
import {StandardToasts} from "@/utils/utils";
import axios from "axios";
axios.defaults.xsrfCookieName = 'csrftoken'
axios.defaults.xsrfHeaderName = "X-CSRFTOKEN"
export default {
name: "SearchSettingsComponent",
props: {
user_id: Number,
},
data() {
return {
user_preferences: undefined,
languages: [],
}
},
mounted() {
this.user_preferences = this.preferences
this.languages = window.AVAILABLE_LANGUAGES
this.loadSettings()
},
methods: {
loadSettings: function () {
let apiFactory = new ApiApiFactory()
apiFactory.retrieveUserPreference(this.user_id.toString()).then(result => {
this.user_preferences = result.data
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
})
},
updateSettings: function (reload) {
let apiFactory = new ApiApiFactory()
apiFactory.partialUpdateUserPreference(this.user_id.toString(), this.user_preferences).then(result => {
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_UPDATE)
if (reload !== undefined) {
location.reload()
}
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_UPDATE, err)
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,59 @@
<template>
<div v-if="user_preferences !== undefined">
</div>
</template>
<script>
import {ApiApiFactory} from "@/utils/openapi/api";
import {StandardToasts} from "@/utils/utils";
import axios from "axios";
axios.defaults.xsrfCookieName = 'csrftoken'
axios.defaults.xsrfHeaderName = "X-CSRFTOKEN"
export default {
name: "ShoppingSettingsComponent",
props: {
user_id: Number,
},
data() {
return {
user_preferences: undefined,
languages: [],
}
},
mounted() {
this.user_preferences = this.preferences
this.languages = window.AVAILABLE_LANGUAGES
this.loadSettings()
},
methods: {
loadSettings: function () {
let apiFactory = new ApiApiFactory()
apiFactory.retrieveUserPreference(this.user_id.toString()).then(result => {
this.user_preferences = result.data
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
})
},
updateSettings: function (reload) {
let apiFactory = new ApiApiFactory()
apiFactory.partialUpdateUserPreference(this.user_id.toString(), this.user_preferences).then(result => {
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_UPDATE)
if (reload !== undefined) {
location.reload()
}
}).catch(err => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_UPDATE, err)
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -385,7 +385,7 @@ export default {
return [item?.recipe_mealplan?.mealplan_note, item?.ingredient_note].filter(String)
},
formatOneCreatedBy: function (item) {
return [this.$t("Added_by"), item?.created_by.username, "@", this.formatDate(item.created_at)].join(" ")
return [this.$t("Added_by"), item?.created_by.display_name, "@", this.formatDate(item.created_at)].join(" ")
},
openRecipeCard: function (e, item) {
this.genericAPI(this.Models.RECIPE, this.Actions.FETCH, {id: item.recipe_mealplan.recipe}).then((result) => {

View File

@@ -591,7 +591,7 @@ export class Models {
type: "lookup",
field: "shared",
list: "USER",
list_label: "username",
list_label: "display_name",
label: "shared_with",
multiple: true,
},

View File

@@ -279,11 +279,29 @@ export interface CustomFilterShared {
*/
id?: number;
/**
*
* Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
* @type {string}
* @memberof CustomFilterShared
*/
username?: string;
/**
*
* @type {string}
* @memberof CustomFilterShared
*/
first_name?: string;
/**
*
* @type {string}
* @memberof CustomFilterShared
*/
last_name?: string;
/**
*
* @type {string}
* @memberof CustomFilterShared
*/
display_name?: string;
}
/**
*
@@ -2592,11 +2610,29 @@ export interface ShoppingListCreatedBy {
*/
id?: number;
/**
*
* Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
* @type {string}
* @memberof ShoppingListCreatedBy
*/
username?: string;
/**
*
* @type {string}
* @memberof ShoppingListCreatedBy
*/
first_name?: string;
/**
*
* @type {string}
* @memberof ShoppingListCreatedBy
*/
last_name?: string;
/**
*
* @type {string}
* @memberof ShoppingListCreatedBy
*/
display_name?: string;
}
/**
*
@@ -3491,6 +3527,43 @@ export interface Unit {
*/
description?: string | null;
}
/**
*
* @export
* @interface User
*/
export interface User {
/**
*
* @type {number}
* @memberof User
*/
id?: number;
/**
* Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
* @type {string}
* @memberof User
*/
username?: string;
/**
*
* @type {string}
* @memberof User
*/
first_name?: string;
/**
*
* @type {string}
* @memberof User
*/
last_name?: string;
/**
*
* @type {string}
* @memberof User
*/
display_name?: string;
}
/**
*
* @export
@@ -3534,25 +3607,6 @@ export interface UserFile {
*/
file_size_kb?: number;
}
/**
*
* @export
* @interface UserName
*/
export interface UserName {
/**
*
* @type {number}
* @memberof UserName
*/
id?: number;
/**
*
* @type {string}
* @memberof UserName
*/
username?: string;
}
/**
*
* @export
@@ -4664,6 +4718,39 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
options: localVarRequestOptions,
};
},
/**
*
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createUser: async (user?: User, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/api/user/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(user, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} name
@@ -5646,6 +5733,39 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
destroyUser: async (id: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('destroyUser', 'id', id)
const localVarPath = `/api/user/{id}/`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -7045,7 +7165,7 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
* @throws {RequiredError}
*/
listUsers: async (options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/api/user-name/`;
const localVarPath = `/api/user/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
@@ -8303,6 +8423,43 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
partialUpdateUser: async (id: string, user?: User, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('partialUpdateUser', 'id', id)
const localVarPath = `/api/user/{id}/`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(user, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -9484,7 +9641,7 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
retrieveUser: async (id: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('retrieveUser', 'id', id)
const localVarPath = `/api/user-name/{id}/`
const localVarPath = `/api/user/{id}/`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -10705,6 +10862,43 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateUser: async (id: string, user?: User, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('updateUser', 'id', id)
const localVarPath = `/api/user/{id}/`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(user, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -11073,6 +11267,16 @@ export const ApiApiFp = function(configuration?: Configuration) {
const localVarAxiosArgs = await localVarAxiosParamCreator.createUnit(unit, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createUser(user?: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(user, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} name
@@ -11368,6 +11572,16 @@ export const ApiApiFp = function(configuration?: Configuration) {
const localVarAxiosArgs = await localVarAxiosParamCreator.destroyUnit(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async destroyUser(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.destroyUser(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -11765,7 +11979,7 @@ export const ApiApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listUsers(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<UserName>>> {
async listUsers(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<User>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listUsers(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
@@ -12135,6 +12349,17 @@ export const ApiApiFp = function(configuration?: Configuration) {
const localVarAxiosArgs = await localVarAxiosParamCreator.partialUpdateUnit(id, unit, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async partialUpdateUser(id: string, user?: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.partialUpdateUser(id, user, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -12490,7 +12715,7 @@ export const ApiApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async retrieveUser(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserName>> {
async retrieveUser(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveUser(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
@@ -12851,6 +13076,17 @@ export const ApiApiFp = function(configuration?: Configuration) {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateUnit(id, unit, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateUser(id: string, user?: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(id, user, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -13113,6 +13349,15 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
createUnit(unit?: Unit, options?: any): AxiosPromise<Unit> {
return localVarFp.createUnit(unit, options).then((request) => request(axios, basePath));
},
/**
*
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createUser(user?: User, options?: any): AxiosPromise<User> {
return localVarFp.createUser(user, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} name
@@ -13379,6 +13624,15 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
destroyUnit(id: string, options?: any): AxiosPromise<void> {
return localVarFp.destroyUnit(id, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
destroyUser(id: string, options?: any): AxiosPromise<void> {
return localVarFp.destroyUser(id, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -13740,7 +13994,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listUsers(options?: any): AxiosPromise<Array<UserName>> {
listUsers(options?: any): AxiosPromise<Array<User>> {
return localVarFp.listUsers(options).then((request) => request(axios, basePath));
},
/**
@@ -14076,6 +14330,16 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
partialUpdateUnit(id: string, unit?: Unit, options?: any): AxiosPromise<Unit> {
return localVarFp.partialUpdateUnit(id, unit, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
partialUpdateUser(id: string, user?: User, options?: any): AxiosPromise<User> {
return localVarFp.partialUpdateUser(id, user, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -14397,7 +14661,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveUser(id: string, options?: any): AxiosPromise<UserName> {
retrieveUser(id: string, options?: any): AxiosPromise<User> {
return localVarFp.retrieveUser(id, options).then((request) => request(axios, basePath));
},
/**
@@ -14724,6 +14988,16 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
updateUnit(id: string, unit?: Unit, options?: any): AxiosPromise<Unit> {
return localVarFp.updateUnit(id, unit, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateUser(id: string, user?: User, options?: any): AxiosPromise<User> {
return localVarFp.updateUser(id, user, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -15034,6 +15308,17 @@ export class ApiApi extends BaseAPI {
return ApiApiFp(this.configuration).createUnit(unit, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/
public createUser(user?: User, options?: any) {
return ApiApiFp(this.configuration).createUser(user, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} name
@@ -15358,6 +15643,17 @@ export class ApiApi extends BaseAPI {
return ApiApiFp(this.configuration).destroyUnit(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/
public destroyUser(id: string, options?: any) {
return ApiApiFp(this.configuration).destroyUser(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -16195,6 +16491,18 @@ export class ApiApi extends BaseAPI {
return ApiApiFp(this.configuration).partialUpdateUnit(id, unit, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/
public partialUpdateUser(id: string, user?: User, options?: any) {
return ApiApiFp(this.configuration).partialUpdateUser(id, user, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} id A unique integer value identifying this user file.
@@ -16979,6 +17287,18 @@ export class ApiApi extends BaseAPI {
return ApiApiFp(this.configuration).updateUnit(id, unit, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} id A unique integer value identifying this user.
* @param {User} [user]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/
public updateUser(id: string, user?: User, options?: any) {
return ApiApiFp(this.configuration).updateUser(id, user, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} id A unique integer value identifying this user file.