mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-12 19:31:31 +08:00
26 lines
642 B
TypeScript
26 lines
642 B
TypeScript
import axios from 'api';
|
|
import { ErrorResponse, SuccessResponse } from 'types/api';
|
|
import {
|
|
UpdateUserPreferenceProps,
|
|
UpdateUserPreferenceResponseProps,
|
|
} from 'types/api/preferences/userOrgPreferences';
|
|
|
|
const updateUserPreference = async (
|
|
preferencePayload: UpdateUserPreferenceProps,
|
|
): Promise<
|
|
SuccessResponse<UpdateUserPreferenceResponseProps> | ErrorResponse
|
|
> => {
|
|
const response = await axios.put(`/user/preferences`, {
|
|
preference_value: preferencePayload.value,
|
|
});
|
|
|
|
return {
|
|
statusCode: 200,
|
|
error: null,
|
|
message: response.data.status,
|
|
payload: response.data.data,
|
|
};
|
|
};
|
|
|
|
export default updateUserPreference;
|