Updates the pointsExpiration
status to DISABLED
.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function disablePointsExpiration(): Promise<DisablePointsExpirationResponse>;
import { programs } from "wix-loyalty.v2";
import { webMethod, Permissions } from "wix-web-module";
import { elevate } from "wix-auth";
const elevatedDisablePointsExpiration = elevate(
programs.disablePointsExpiration,
);
export const disablePointsExpiration = webMethod(
Permissions.Anyone,
async () => {
try {
const result = await elevatedDisablePointsExpiration();
return result;
} catch (error) {
console.error(error);
// Handle the error
}
},
);
/* Promise resolves to:
*
* {
* "loyaltyProgram": {
* "_createdDate": "2024-06-05T20:31:49.155Z",
* "_updatedDate": "2024-06-06T10:36:24.525Z",
* "name": "Loyalty",
* "pointDefinition": {
* "icon": "shapes/8de7ee72dcd944caa60f9e226d900f1d.svg"
* },
* "pointsExpiration": {
* "status": "DISABLED",
* "monthsOfInactivity": 3,
* "expiringPointsPercentage": 100
* },
* "premiumFeatures": {
* "loyaltyProgram": true,
* "tiers": true,
* "pointsExpiration": true
* },
* "status": "ACTIVE"
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.