Revert "[ACS-9166] Migrate Saved Searches to preferences API from config file…" (#10566)

This reverts commit 184a38a0ef.
This commit is contained in:
MichalKinas
2025-01-20 12:38:27 +01:00
committed by GitHub
parent c4b3a53d56
commit fcd6e25dc6
5 changed files with 130 additions and 171 deletions

View File

@@ -84,25 +84,4 @@ export class PreferencesApi extends BaseApi {
queryParams
});
}
updatePreference(personId: string, preferenceName: string, preferenceValue: string): Promise<PreferenceEntry> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(preferenceName, 'preferenceName');
throwIfNotDefined(preferenceValue, 'preferenceValue');
const pathParams = {
personId,
preferenceName
};
const bodyParam = {
value: preferenceValue
};
return this.put({
path: '/people/{personId}/preferences/{preferenceName}',
pathParams,
bodyParam: bodyParam
});
}
}

View File

@@ -2,11 +2,10 @@
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------------------|----------------------------------------------------------|-------------------|
| [getPreference](#getPreference) | **GET** /people/{personId}/preferences/{preferenceName} | Get a preference |
| [listPreferences](#listPreferences) | **GET** /people/{personId}/preferences | List preferences |
| [updatePreference](#updatePreference) | **POST** /people/{personId}/preferences/{preferenceName} | Update preference |
| Method | HTTP request | Description |
|-------------------------------------|---------------------------------------------------------|------------------|
| [getPreference](#getPreference) | **GET** /people/{personId}/preferences/{preferenceName} | Get a preference |
| [listPreferences](#listPreferences) | **GET** /people/{personId}/preferences | List preferences |
## getPreference
@@ -72,36 +71,6 @@ preferencesApi.listPreferences(`<personId>`, opts).then((data) => {
});
```
## updatePreference
Update preference
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
### Parameters
| Name | Type | Description |
|---------------------|--------|-----------------------------|
| **personId** | string | The identifier of a person. |
| **preferenceName** | string | The name of the preference. |
| **preferenceValue** | string | New preference value. |
**Return type**: [PreferenceEntry](#PreferenceEntry)
**Example**
```javascript
import { AlfrescoApi, PreferencesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const preferencesApi = new PreferencesApi(alfrescoApi);
const newPreferenceValue = 'test';
preferencesApi.updatePreference(`<personId>`, `<preferenceName>`, newPreferenceValue).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## PreferencePaging
@@ -136,4 +105,4 @@ preferencesApi.updatePreference(`<personId>`, `<preferenceName>`, newPreferenceV
| Name | Type | Description |
|--------|--------|----------------------------------------------------------------------|
| **id** | string | The unique id of the preference |
| value | string | The value of the preference. Note that this can be of any JSON type. |
| value | string | The value of the preference. Note that this can be of any JSON type. |