text: import * as dynamoDbLib from "./libs/dynamodb-lib";
  import {success, failure} from "./libs/response-lib";
  
  export async function main(event, context, callback) {
    const data = JSON.parse(event.body);
    
    const params = {
        TableName: "yelp_preferences",
        
        Item: {
            userid: event.requestContext.identity.cognitoIdentityId,
            longitude: data.longitude,
            latitude: data.latitude,
            createdAt: Date.now()
        }
        
    };
    
    try {
        await dynamoDbLib.call("put", params);
        callback(null, success(params.Item));
    } catch (e) {
        callback(null, failure({ status: false }));
    }
  }